Questions tagged [android-fragmentactivity]

An Activity subclass introduced through the compatibility package to provide an implementation of the Fragment framework on version below Honeycomb.

An Activity subclass introduced through the compatibility package to provide an implementation of the Fragment framework on version below Honeycomb. This class doesn't work with Fragments from the SDK, it needs the Fragment related classes from the compatibility package.

More information can be found in the documentation of the FragmentActivity.

2111 questions
14
votes
4 answers

Android Navigation Drawer Fragment State

I'm currently utilizing the Navigation Drawer for my Android APP. In my first fragment, I've a fragment that loads data using Facebook's Graph API. Thus, when my App is first loaded, it first goes to the first fragment. Then, I use the Navigation…
14
votes
8 answers

AsyncTask runs on each page of the ViewPager

I have 3 Tabs like in the android development tutorial Now what I want to do is very simple I use Fragments on each page. I want to show different content from a rss feed on each page. The problem is when I go to the next tab it runs AsyncTask…
14
votes
3 answers

Android Lifecycle management of Fragments within ViewPager and FragmentPagerAdapter

I have been struggling to find out what the correct management of Fragments within a FragmentActivity with a ViewPager is. Before I go into details, a quick summary of the issue that I am facing is the following: I have a FragmentActivity with a…
14
votes
1 answer

Fragment Activity - app died, no saved state

I'm facing a very confusing issue for a very small number of my users. The error occurs when a button is pressed inside a Fragment, that starts another Fragment Activity. Here is the stack trace: I/20:22:23.901 ActivityManager( 1668) Start proc…
brandall
  • 6,094
  • 4
  • 49
  • 103
14
votes
3 answers

Android Nested Fragment Approach

I am newbie in using android fragments .I got a scenario Let me explain it i got Main Activity that extends FragmentActivity .My main activity consists of two Fragments Option List That extends Fragment Details List that extends…
edwin
  • 7,985
  • 10
  • 51
  • 82
13
votes
1 answer

Is it safe to commit a FragmentTransaction inside onActivityResult()?

Years ago, I ran into a problem in one of my apps when I tried to commit a FragmentTransaction inside my onActivityResult() callback. Googling around, I found this question and answer, which say At the time that onActivityResult() is called, the…
13
votes
4 answers

OnOptionsItemSelected in activity is called before onOptionsItemSelected in fragment. Other way possible?

I have an activity which can contain several fragments. Each of the fragments can have their own menu entries in the ActionBar. This works fine so far and each item is clickable and performs the desired action. My problem is the following. In the…
MrHill
  • 1,271
  • 3
  • 12
  • 19
13
votes
4 answers

Can't retain nested fragments

Is there another way of saving the state of the nested fragment ? Or if we shouldn't do this, why ? Thanks ! 02-13 11:42:43.258: E/AndroidRuntime(7167): java.lang.IllegalStateException: Can't retain fragements that are nested in other…
Bogdan Zurac
  • 6,348
  • 11
  • 48
  • 96
12
votes
6 answers

Android Fragment - move from one View to another?

Can i first add a Fragment to a View, then "detach" it, and then "re-attach" it to another View? In code, i want to: fragOne one = new fragOne(); getSupportFragmentManager().beginTransaction() .add(R.id.left, one,…
12
votes
1 answer

Bind service to FragmentActivity or Fragment?

Is it better to bind service to FragmentActivity: bindService(Intent, ServiceConnection, int); or to Fragment: getActivity().bindService(Intent, ServiceConnection, int); What is better practice?
pawegio
  • 1,722
  • 3
  • 17
  • 29
11
votes
5 answers

How to Remove Fragment from FragmentPagerAdapter?

I know there are some topics about this here already but I could not find a solution which I could get to work for my case. I have a working sliding gallery using a custom FragmentActivity and FragmentPagerAdapter which holds a list of…
11
votes
0 answers

startActivityForResult with singleTop launch mode doesn't work properly on Android 9

I have an Activity and fragment which is settled through jetpack navigation. One of my activity has launchMode set to singleTop in AndroidManifest.xml file. When I use startActivity method in my fragment it works as expected no any new Activity…
11
votes
3 answers

Adding actionbar to FragmentActivity

I am making an app that is using google maps for some specific reason. So I created an Google Maps app in Android Studio and I got an activity that extends FragmentActivity. Everything works perfectly but now I want to add the action bar at top of…
11
votes
2 answers

Dismissed dialog fragment reappears again when app is resumed

Hi I am developing an app that uses maps. I am using Fragment Activity and a fragment named Fragment-A. In Fragment-A there is a button, on clicking that button a Dialog Fragment pops up, displays a map with some location received previously from…
11
votes
2 answers

Google+ Login Not working properly on Android fragment

I am working with google+ login to my application and when i done it using a activity its work charm and after that i move my code into a fragment and after that when i try to login to google+ its not working i have to open the fragment activity 2…