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

Avoiding duplicate code blocks

I have something like this in my code: switch (item.getItemId()) { case R.id.search: if (currentFragment == null || !(currentFragment instanceof ClipsFragment)) { ClipsFragment clipsFragment =…
Binoy Babu
  • 16,699
  • 17
  • 91
  • 134
-1
votes
2 answers

Why isn't the view found for the id?

I'm trying to launch a fragment from an activity. However, when I run the app and click on the button that has to launch the fragment I get the error: java.lang.IllegalArgumentException: No view found for id 0x7f0e0074…
-1
votes
1 answer

Nested Fragment not retaining its state

I have a Fragment A (say) which contains a FragmentPagerAdaptor, which further contains Fragments (having list view). When I click on a list item, I replace the complete Fragment A with another fragment (say B), I have also added the transaction for…
Nitesh
  • 3,868
  • 1
  • 20
  • 26
-1
votes
3 answers

How can i use getSupportFragmentManager() in a class extended by fragment?

i have a class which is extended from a fragment ... and i want to getSupportFragmentManager() for finding the map fragment... this is the fragment xml
-1
votes
1 answer

What event of Fragment will be called when I click device back?

I am adding a fragment B on top of another fragment A as follows: fragmentManager.beginTransaction().add(R.id.frame_container, fragment).addToBackStack("post_details").commit(); The issue is, when I click on device back on B, I need an anchor in…
-1
votes
1 answer

Controlling which fragment is shown from navDrawer

I am working on this application that has a viewPager and a few swipeable fragments in its MainActivity. Today I implemented navigation drawer but I do not know how to control which fragment is shown from drawer`s DrawerItemClickListener class. Is…
-1
votes
2 answers

How to pass fagment manager from fragment

I have one class: class a extend fragment { adt a=new adp(fragmentmanager()); /* here is the error -> fragmentmanager undefined */ } And another class which accept the FragmentManager: class adt extend fragmentpageadapter { public adt…
user3395433
  • 123
  • 2
  • 10
-1
votes
1 answer

"The specified child already has a parent. You must call removeView() on the child's parent first" when replace fragment

First I want to explain my layout. It is a "tab list in a tab" which means a list view is controlled by a tab and the tab list is controlled by another tab. Hope you can understand what I mean... my two tab widgets: (bottom tab: main control…
-1
votes
2 answers

Reusing Fragment View in this way will cause some problems?

This is the situation. I have a listview in a fragment A with an infinite list that is populated throught web service when user reach bottom. Each item in the listview have a "View more" link that open a detailed fragment B for this item. I'm using…
edrian
  • 4,501
  • 5
  • 31
  • 35
-1
votes
1 answer

Why can't I use FragmentSupportManager inside a FragmentsStatePagerAdapter?

In the android documentation on FragmentStatePagerAdapter it is explained that the adapter can be set up like this: public static class MyAdapter extends FragmentStatePagerAdapter { public MyAdapter(FragmentManager fm) { super(fm); …
user2426316
  • 7,131
  • 20
  • 52
  • 83
-1
votes
3 answers

How to keep data inside a fragment

I'm using a ViewPager and a FragmentManager to fill some EditText and click on next button to go ahead. But when I click on the previous button to go back to the last fragment, the information inside the form are lost, because I always…
Nizar B.
  • 3,098
  • 9
  • 38
  • 56
-2
votes
2 answers

Why using two or more fragments in the same Activity?

I am a beginner android developer, and right now I'm learning about fragments in android, and so and as I read that : A fragment is just a part of an activity. You can have a fragment that takes up part of a screen or a whole screen. Or you can…
-2
votes
2 answers

How to resolve getSupportFragmentManager and getFragmentManager

I am very new in android programming and i am confused, which library should be used. FragmentManager fragmentManager = getSupportFragmentManager(); Fragment start_frag = fragmentManager.findFragmentById(R.id.fragment_container); …
-2
votes
1 answer

Tabbed activity(fragment) to activity navigation using onClick

I have a Tabbed activity with 3 tabs and each tab has its own fragment. there's a button inside the first tab which i want to click and navigate to another Tabbed activity (or any activity which has a fragment). How do I accomplish this ? I am…
-2
votes
1 answer

What are the different ways through which the fragmentation issue can be solved in Android devices, while making an Android Application?

Most of the resources on the web talk about the problem of fragmentation in android devices, but very less on how to solve it. Can anyone give some resource links/ tips so that we can reduce its effect in android applications, enabling the android…
1 2 3
46
47