Questions tagged [fragmentmanager]

FragmentManager is an interface for interacting with Fragment objects inside an Activity in Android. While the FragmentManager API was introduced in HONEYCOMB, a version of the API at is also available for use on older platforms through FragmentActivity. For more information about using fragments, read the Fragments developer guide.

700 questions
0
votes
1 answer

Difference between android.support.v4.app.FragmentManager and android.app.FragmentManager;

I have faced problem while creating fragments. In my mainActivity i am calling this fragment.. Fragment fr = new Article(); FragmentManager fm = getFragmentManager(); FragmentTransaction fragmentTransaction =…
Zar E Ahmer
  • 33,936
  • 20
  • 234
  • 300
0
votes
2 answers

how do I restore the last ListFragment from the current Fragment

My app has structure like this MainActivity extends ActionBarActivity -- on button press -> ListFragment --on list item press--> Fragment When in Fragment and if back key is pressed it goes to MainActivity directly . How do I make it to go to…
0
votes
1 answer

Remove all child Fragments

I have a Fragment, which xml contains something like this:
user3621165
  • 212
  • 4
  • 16
0
votes
1 answer

Fragment not getting replaced on re-entry

I've been stumped on this for two days now: 1 activity, 3 fragments (A, B and C). B and C are tabs. If I replace fragment A with B and add A to the back stack like so: fragmentManager.beginTransaction() .addToBackStack("A_TO_B_TAG") …
Daniel Wilson
  • 18,838
  • 12
  • 85
  • 135
0
votes
1 answer

FragmentManager and ScreenOrientationChanging

I have 1 activity, 2 layouts for both portrait and landscape and 2 fragments. in portrait layout there is only 1 fragment, in landscape there are 2 fragments stand together. when I run the activity as portrait mode at the beginning, fragmentmanager…
0
votes
0 answers

After replacing Fragment, Activity still detects Fragment is visible

I have one Activity that hosts many Fragments. In Fragment A, I am adding a dialog when the user presses the back button to ask if they are sure if they want to leave this fragment. I added this code in the Activity's onBackPressed to control…
The Nomad
  • 7,155
  • 14
  • 65
  • 100
0
votes
1 answer

Adding Fragment to containers with the same ID

I have a ViewPager to implement swipe between "holder" Fragments. And inside them I need to add multiple Fragments to their respective containers. The problem is, Im using FragmentTransaction.add(containerID, fragment);, but since there are multiple…
Caio Faustino
  • 165
  • 1
  • 15
0
votes
1 answer

Android - Start a fragment class from an activity

I have a navigation drawer where every voice in the sliding menu correspond to a fragment class, here is my LoginFragment voice of the menu: public class LoginFragment extends Fragment { Button btnLogin; Button btnLinkToRegister; EditText…
Steve
  • 11
  • 3
0
votes
1 answer

Conserving Android session information in fragments during resource changes during rotation, etc

I have developed an Android application that has four tabs. Two of these tabs are used to access data in a Sqlite database, one tab has a scrollable table showing contents of the database, and the fourth tab shows GPS data coming into the device…
portsample
  • 1,986
  • 4
  • 19
  • 35
0
votes
3 answers

android google map in fragment - can't remove

In my application I am trying to remove map fragment onDestroyView(). I am using support v4 library. I am sure it crashed when I try to remove map layout.xml
pmb
  • 2,327
  • 3
  • 30
  • 47
0
votes
0 answers

Trying to get map from fragmentManager always return null

I'm trying to do an android applications that uses ViewPager. In the third page I have a map which I instantiate inside the xml of the fragment:
kevings14
  • 1,986
  • 2
  • 18
  • 19
0
votes
1 answer

Change Fragment destroy my Layout

Can someone help me with the following: I just want, that the fragments in the middle change, when i click of one button: But if i click of one, this one happens: Anybody knows, what there is wrong? My Fragments are just simple LineaLayouts with a…
0
votes
1 answer

Change Fragment dynamic

I have 2 questions. First, can me say someone, why this not works? I just try to change the fragment, but he does nothing. I just see the first fragment. mainActivity: ... if (savedInstanceState == null) { fm.beginTransaction() …
user3384194
  • 141
  • 1
  • 1
  • 11
0
votes
1 answer

Cannot work with SherlockFragment

I have a problem with SherlockFragment. If I change "extends SherlockFragment" with "Fragment", works perfectly. But when working with Sherlock, I would it work this way. This code is a fragment: import…
0
votes
1 answer

Android - show fragment within a dialog

I'm developing an android app that uses fragments as the base of the navigation flow. In some point, i fell in a problem that I couldnt resolve. All fragments extends from a base class which has some properties that the navigation manager needs,…
Diego
  • 738
  • 1
  • 7
  • 19