Top "Fragment" questions

**DO NOT USE**: fragment is an ambiguous tag, used to refer to numerous technologies.

Replace a fragment programmatically

I have three fragments as shown in below figure. I have added all these three fragments in LinearLayout using .xml …

android replace fragment
Is it possible to manually call onCreateView in a Fragment?

Is it possible to manually call the method onCreateView in a Fragment or, if not, is there some way I …

android fragment android-view fragment-tab-host
android.support.v4.app.FragmentManager OR android.app.FragmentManager?

I'm learning Android development. I get stuck at something that should be very easy. Im creating an App with one …

android android-fragments fragment fragmentmanager
NullPointerException : FragmentManager.beginTransaction()

I'm getting this error while trying to launch a Fragment from a first Fragment : java.lang.NullPointerException: Attempt to invoke …

android nullpointerexception fragment fragmenttransaction
Android Fragment does not respect match_parent as height

Sorry for the huge code dump, but I'm truly lost. MyActivity.java onCreate: super.onCreate(savedInstanceState); setContentView(R.layout.activity_…

android center android-linearlayout fragment android-framelayout
Unable to override onCreateOptionsMenu in ListFragment

I created an app that supports both phone and tablet version so i use the android-support-v4.jar library. My activity …

android overriding compatibility fragment
Showing progress dialog within DialogFragment

I would like to show a progress dialog within a dialog fragment. However when I am using this code ProgressDialog …

android android-fragments fragment progressdialog
Event when the FragmentTransaction is completed

Is it possible to have an event when the FragmentTransaction is completed ? FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft.replace(R.id.…

android listener fragment
Android force Fragment to rebuild View

I have a simple app that has two fragments and when in landscape mode, both fragments are shown side by …

android view fragment layout-inflater
Fragment vs. Custom View in Android

The Fragment and Custom View can achieve the similar function, I know that fragment is more re-usable comparing with custom …

android fragment android-custom-view