Top "Android-fragments" questions

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

How to pass a variable from Activity to Fragment, and pass it back?

I am currently making an android app, and I want to pass a date between activity and fragment. My activity …

android android-fragments android-activity
Android Fragment onAttach() deprecated

I have updated my app to use the latest support library (version 23.0.0), I've found out that they deprecated the onAttach() …

android android-fragments
Remove old Fragment from fragment manager

I'm trying to learn how to use Fragments in android. I'm trying to remove old fragment when new fragment is …

android android-fragments android-tabhost
java.lang.IllegalStateException: Fragment not attached to Activity

I am rarely getting this error while making an API call. java.lang.IllegalStateException: Fragment not attached to Activity I …

android android-fragments android-activity android-volley android-lifecycle
Problems with Android Fragment back stack

I've got a massive problem with the way the android fragment backstack seems to work and would be most grateful …

android android-fragments back-stack
Where/How to getIntent().getExtras() in an Android Fragment?

With Activities, I used to do this: In Activity 1: Intent i = new Intent(getApplicationContext(), MyFragmentActivity.class); i.putExtra("name", items.…

android android-intent android-fragments android-activity
Android Studio and android.support.v4.app.Fragment: cannot resolve symbol

I am tryng out Android Studio instead of Eclipse. I install it and then start a completely new project and …

android android-fragments android-studio
Fragments within Fragments

I'm wondering if this is actually a bug in the Android API: I have a setup like so: ┌----┬---------┐ | | | | 1 | 2 | | |┌…

android android-fragments android-nested-fragment
Is this the right way to clean-up Fragment back stack when leaving a deeply nested stack?

I'm using the Android Compatibility library to implement fragments and have extended the layout sample so that a fragment contains …

android android-fragments fragment-backstack
How do I make WRAP_CONTENT work on a RecyclerView

I have a DialogFragment that contains a RecyclerView (a list of cards). Within this RecyclerView are one or more CardViews …

android android-layout android-studio android-fragments android-recyclerview