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
5
votes
2 answers

onPrepareOptionsMenu acts weird if API is called from inside

I have a need to enable and disable menu items based on the API call response and it has to be called everytime the menu shows up. I need asynctask because I have to show progressbar @Override public boolean onPrepareOptionsMenu (Menu menu)…
5
votes
1 answer

Freezing UI when fragment transaction

I'm facing problem with replacing fragment using FragmentManager. My problem is freezing the UI. I'm trying to find some good practices and/or library to handle my problems. Part of my code: Main activity…
5
votes
1 answer

using a FragmentTabHost with a ViewPager

I want to create a swipe tab interface using a FragmentTabHost with a ViewPager. So far I got the Fragments to slide. The only thing that's happening is that the fragments are able slide behind the tabs which are disabled/stuck and not working. How…
5
votes
2 answers

Getting exception as Failure saving state: active Fragment has cleared index: -1 when I am pressing home button of android device

I am facing some weird issue while I am pressing home button of android and while starting new activity. My stacktrace is as follows 05-13 18:06:21.182: E/FragmentManager(5674): Failure saving state: active Fragment{411d96d8} has cleared index:…
5
votes
1 answer

FragmentManager.getFragment() NullPointerException

I am using support library v4 and failing to save fragment's state. @Override protected void onSaveInstanceState(Bundle outState) { ... if(mFragment != null) getSupportFragmentManager().putFragment(outState, "frag", mFragment); …
5
votes
1 answer

Intercepting ActionBar Home button in Fragment

I can successfully intercept the ActionBar home button from my NavigationDrawerFragment, which is added to my MainActivity, like so: @Override public boolean onOptionsItemSelected(MenuItem item) { if (!loggedIn() && item.getItemId() ==…
5
votes
1 answer

Fragment onCreate called multiple times when reload the Fragment

Below is my code: public class MyListFragmentActivity extends FragmentActivity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); System.out.println("DEBUG : MLFA onCreate"); if…
5
votes
3 answers

Pass ActionBar search query to fragment

Here is the seen I have a SHERLOCK FRAGMENT ACTIVITY which holds four FRAGMENTS and a SEARCH VIEW. There are 4 fragments in which last is FRAGMENT SEARCH RESULTS My question is how to pass data of search query to FRAGMENT SEARCH RESULTS from search…
5
votes
1 answer

Implement some functionality like in Instagram android app

There are two things which I like on the Instagram for Android app and I'd like to implement them in my app. 1. Infinite go back in history of fragments If you tap on a user, you can see his details, taping on followers will return a list of…
Alin
  • 14,809
  • 40
  • 129
  • 218
5
votes
1 answer

IllegalStateException: Can not perform this action after onSaveInstanceState in FragmentActivity class

This is the code which i have written.i could not able to find when this functionality crashes but it works sometimes. public class ListFragmentActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { …
Venkat
  • 3,447
  • 6
  • 42
  • 61
5
votes
2 answers

getSupportFragmentManager() cause java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState

I was trying to figure out why: getSupportFragmentManager().beginTransaction().commit(); fails, with java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState in a very basic FragmentActivity class. So here was my…
5
votes
4 answers

Blank screen on SlidingMenu when using with Fragment (GMap)

So i use SlidingMenu library with a FragmentActivity in my app. There is a GoogleMap in the layout and a menu on the left side with some content. When i pull the menu to see it, there is a big black rectangle there, covering my sliding menu content.…
5
votes
1 answer

Switching Fragments in Master/Detail Flow

I am attempting to create an app which has a Master/Detail flow using Fragments. Selecting an item will open a detail fragment which may then which to "open" another fragment and add it to the back stack. I have renamed classes to help illustrate…
tgrosinger
  • 2,463
  • 2
  • 30
  • 38
5
votes
1 answer

The method add(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, Fragment, String)

I have this problem .. The method add(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, Fragment, String) when using the following code inside a FragenmtActivity…
Adham
  • 63,550
  • 98
  • 229
  • 344
5
votes
3 answers

pull to refresh and loadmore listview like facebook

here i am using sliding drawer. in that on click home icon it shows 3 tabs 1) which concept should i apply for tab ? 2) I want to apply pulltoreferesh and loadmore in listview like facebook ? in that you have also seen that when scrolling up…