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
9
votes
4 answers

Android Set Text of TextView in Fragment that is in FragmentPagerAdapter

This one is driving me nuts. Basically, I want to create a ViewPager and add a few Fragments to it. Then, all I want to do, it set a value in one of the Fragment's TextViews. I can add the Fragments fine, and they attach, but when I go to…
8
votes
6 answers

How to implement show and hide fragment inside fragment in android

How to implement show and hide fragment inside fragment in Android? I have added two fragment inside activity. One fragment containing menu and one fragment contain sub menu. I have lot of button in menu fragment like home, idea, etc. If i click…
kumar
  • 645
  • 2
  • 14
  • 24
8
votes
4 answers

Cannot acces ActivityCompatApi23 when trying to use FragmentActivity

I'm trying to use a ViewPager on my smartwatch, but I keep getting an error when trying to rebuild/run/debug my application. I'm using a FragmentActivity, which is where the error occurs. I searched stackoverflow and tutorial websites to see what…
8
votes
5 answers

NullPointerException: Attempt to read from field 'int android.app.Fragment.mContainerId' on a null object reference

Having some interesting issue with transaction on fragments on Android Lollipop ONLY. Crash happens when i go back and remove previously added fragment. Here is stacktrace : FATAL EXCEPTION: main Process: com.parkme.consumer, PID: 15560 …
Magirus
  • 133
  • 1
  • 2
  • 12
8
votes
3 answers

Button On Activity Showing Over Fragment

I have a fragment that needs to be displayed over the activity but the button in the activity keeps showing up over the fragment.I need the fragment to completely overlap the activity. The xml of the activity.
8
votes
2 answers

how check if an activity implements an interface after onAttach(Activity activity) has been depreacted

Since onAttach(Activity) has been deprecated on SDK 23, which is the best method in the Fragment lifecycle for checking if an Activity is implementing an interface? this code is no longer right and in the future this method could even be removed. …
8
votes
4 answers

Sliding between fragments

I'm developing an app and currently I am trying to add ScreenSlide to it. I managed to do this using a tutorial, but usual sliding between x pages is not quite what I'm looking for. With code provided below I can slide between 5 pages, but pages…
8
votes
1 answer

Using Toolbar in Fragment or in Activity

I am using Android-ObservableScrollView library. Everything works great, but I have activity for holding fragments, so all views are encapsulated in the fragment. In activity there is only FrameLayout for holding fragments. So I need to use Toolbar…
8
votes
6 answers

How to avoid adding same fragment to stack

I need some help. em adding fragment to activity this way. problem is on each call of openFragment it create fragment and add. which is obvious. Question: what modification i do, so it can add fragment only once. on the next call with same fragment…
8
votes
4 answers

Resuming a previous fragment onBackPressed()?

I have a HomeFragment that has a button, which when clicked calls the following: Fragment frag = new CustFragment(); FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction().replace(R.id.home_container,…
u3l
  • 3,342
  • 4
  • 34
  • 51
8
votes
11 answers

Eclipse creates fragment layout automatically, how can i disable it

I dont want to use fragments and fragment layout. Is this possible to disable eclipse's that property? Firstly, i create a class and xml files then i declare them in Android Manifest file this works for me but it takes a long time if i can disable…
8
votes
1 answer

FragmentPagerAdapter not restoring fragments upon Orientation Change

EDIT: I found out that the Activity is saving the instance, but the Fragments saved data is not making it up to the Activity savedInstanceState. I'm saving the current time in the outState, but its not making its way all the way up, as the…
8
votes
1 answer

Android getActivity() always returns null inside fragment

I have a strange problem in which I encountered:The getActivity() method always returns null inside fragment. I calling it after the onAttach() and onCreateView() are finishing their run. This fragment lives inside a FragmentActivity() that…
Nativ
  • 3,092
  • 6
  • 38
  • 69
8
votes
2 answers

YouTubePlayerSupportFragment starts duplicate Activity

I am using a YouTubePlayerSupportFragment to embed a YouTube video in my app. When embedded it works very well, the video plays, everything is great. When I tap the Fullscreen button my embedded YouTube video fragment, the first strange thing…
Kenny Wyland
  • 20,844
  • 26
  • 117
  • 229
8
votes
2 answers

Fragment onResume not called

I am having 4 (let's say 1,2,3 & 4) fragments. And at a time any one of them will be visible to User. In 2nd fragment I want to do something when user is coming on it. Now when User navigated to 3rd fragment & hits the back button, I want to run a…
hemu
  • 3,199
  • 3
  • 44
  • 66