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
0 answers

shows "fragmentManager cannot be resolved" , working through Android 4.0 Tutorial 12

Everything else is good except the "fragmentManager" cannot be resolved, what am I doing wrong here? The tutorial skipped over some parts on this section... @Override public void onCreate(Bundle savedInstanceState) { …
0
votes
2 answers

Android Viewpager how can learn ViewPager.getCurrentItem from fragment

Well I'm using viewpager. I am creating views with this: public class CrimePagerActivity extends FragmentActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FragmentManager fm…
0
votes
1 answer

CalendarDatePickerDialog on Activity without support package

I'm using CalendarDatePickerDialog from BetterPickers in my project, if i use a FragmentActivity, then i can use the getSupportFragmentManager(). The problem is that i'm trying to add CWAC-Camera as well, but for that i need to…
Shahar
  • 3,692
  • 4
  • 25
  • 47
0
votes
1 answer

Android - FragmentManager

I am trying to make a little program which allows user to add items into a shopping list. The problem is that the program starts and closes immediately after a short while with the message: "Unfortunately, shopping has stopped" Shopping is the name…
0
votes
1 answer

Replace fragment in viewpager is not working

In my project i am using actionbar with swipeable threefragments(tabs with viewpager), i am trying to replace one of the fragment with fourth fragment, but iam not able to get it.. **Below is my code** public class GetRideFragment extends…
0
votes
1 answer

Getting Null Pointer Exception when starting an AsyncTask although it would seem that the onCreate holds all the variables

I am having an issue with a Fragment and an AsyncTask. The issue is that I am creating a Fragment to run an AsyncTask to run a timer. The code works independently of all my other code and I have tested it numerous times. The issue is that when I…
0
votes
0 answers

Calling Fragment's Method from a Non-Fragmented Class

I am trying to call methodToBeCalled() from my UnrelatedClass. I am new to fragments, and 5 days later, still cannot figure it out. I would greatly appreciate any detailed help! If I did not include necessary code, please let me know and I will…
0
votes
1 answer

navigation within Fragment page

In Home.java activity extends Fragment and I take custom Listview with two buttons.So I want to move next activity when button is clicked. I use Fragement and FragmentMangar code. But It does not work.It is giving error of NullpointerException.I…
user2893626
  • 3
  • 1
  • 4
0
votes
1 answer

getSupportFragmentManager().findFragmentByTag unpredictable behaviour

If I'm adding fragments to my activity like this: fragment_tags = new ArrayList(); fragment_tags.add("user_fragment"); fragment_tags.add("memorial_fragment"); UserFragment user = new UserFragment(); MemorialFragment…
vanomart
  • 1,739
  • 1
  • 18
  • 39
0
votes
1 answer

Dialogbox gives error on .show() in android gingerbread version

I have to implement multiple select dialog box for gingerbread version. My main Activity called EventCreateActivity extends class called BaseActivity and that extends SherlockActivity. main activity public class EventCreateActivity extends…
0
votes
1 answer

Recursive entry to executePendingTransaction

In brief i have such construction: class AlbumPickerFragment extends PageFragment { ... @Override public void onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { …
Semyon Danilov
  • 1,753
  • 1
  • 17
  • 37
0
votes
2 answers

Using a Fragment Layout

My Android app has a requirement where a certain flow has 7 different screens. Now each of these screens has a common top and bottom. So i have chosen to create a FragmentActivity and 7 different Fragments. How do I insert the fragments into the…
-1
votes
2 answers

can not resolve method add for Fragment Transaction - Android

I was just upgrading old android project and stuck at below code : FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); transaction.add(R.id.instructional_tutorial_video_youtube_view, youTubePlayerFragment).commit(); …
-1
votes
1 answer

ViewPager2 Error Fragment Manager is already executing

I am trying to fix a bug where my app crashes if a user performs an orientation change during the onboarding process (I used a 3 fragment viewpager2 layout within JetPack NavHost). I tried adding my viewmodel to it so that it would be lifecycle…
-1
votes
1 answer

How to call class by its name dynamically in Kotlin

Assume I have a fragment called "LoginFragment". I want to use this fragment in add transaction below: fTransaction.add(R.id.login_fragment, LoginFragment()) But I need call it by name dynamically like this: val name =…
weera
  • 884
  • 1
  • 10
  • 21