Top "Android-fragments" questions

Fragments represent reusable behaviors or portions of the user interface in an Android app.

Activity, AppCompatActivity, FragmentActivity, and ActionBarActivity: When to Use Which?

I'm coming from iOS where it's easy and you simply use a UIViewController. However, in Android things seem much more …

android android-fragments android-activity android-actionbaractivity appcompatactivity
Why fragments, and when to use fragments instead of activities?

In Android API 11+, Google has released a new class called Fragment. In the videos, Google suggests that whenever possible (link1, …

android android-layout android-fragments android-activity android-3.0-honeycomb
How to implement OnFragmentInteractionListener

I have a wizard generated app with navigation drawer in android studio 0.8.2 I have created a fragment and added it …

android android-fragments
Replace Fragment inside a ViewPager

I'm trying to use Fragment with a ViewPager using the FragmentPagerAdapter. What I'm looking for to achieve is to replace …

android view android-fragments android-viewpager pager
Display a RecyclerView in Fragment

I'm trying out the new RecyclerView in Android Lollipop and I'm stuck. I'm trying to receive a list, with an …

java android android-fragments android-5.0-lollipop android-recyclerview
How to resume Fragment from BackStack if exists

I am learning how to use fragments. I have three instances of Fragment that are initialized at the top of …

android android-fragments back-stack
How to set a Fragment tag by code?

I haven't found something like setTag(String tagName) method in the Fragment class. The only way to set a Fragment …

android android-3.0-honeycomb android-fragments
Show hide fragment in android

I am developing application which contains 2 fragments and i want to show hide according to my need. Following code has …

android android-fragments show-hide
Cannot call getSupportFragmentManager() from activity

I have an activity which has a fragment. XML: <fragment android:name="com.example.androidcalculator.ResultFragment" android:id="@+id/…

android android-activity android-fragments
Calling a Fragment method from a parent Activity

I see in the Android Fragments Dev Guide that an "activity can call methods in a fragment by acquiring a …

android android-fragments