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

Cannot cast from fragment

I've a two fragments defined in the layout of my MainActivity and set by setContentView. I'd like to call some methods from these fragments, but I don't know how to acces them. Eclipse says: "Cannot cast form Fragment to ListFileFrgament". public…
XorOrNor
  • 8,868
  • 12
  • 48
  • 81
8
votes
2 answers

Fragment Recursive entry to executePendingTransactions Error

I have an error as: 03-01 11:20:43.453: E/AndroidRuntime(31235): java.lang.RuntimeException: Error receiving broadcast Intent { act=com.qz.Blaze.ServiceStarted flg=0x10 } in com.qz.Blaze.$ServiceStartedReceiver@423540f0 03-01 11:20:43.453:…
8
votes
3 answers

FragmentManager NullPointerException when trying to commitAllowingStateLoss

Context: I have an Activity with a Fragment and 3 InnerFragments. When the Fragment onDestroy() is called, I want to remove the inner fragments from the FragmentManager. The code from onDestroy() is below. Problem: FragmentManager throws…
Bogdan Zurac
  • 6,348
  • 11
  • 48
  • 96
8
votes
2 answers

Why is my fragment onCreate being called extensively whenever I page through my applications viewPager?

I'm not quite understanding this fragment lifecycle business. I have a pretty standard 3 page horizontal slider view Pager layout for a "view details" section of my app. I start my app on the middle page of the three. My FragmentActivity sets the…
7
votes
0 answers

Your activity is not yet attached to the Application instance. You can't request ViewModel before onCreate call

I try to run a test on a fragmentDialog that is anchored to a viewId in its hosting activity @Test public void largeScreenDeviceUsesPopup() { final FragmentUtilActivity fragmentActivity = new FragmentUtilActivity(); …
Elad Benda
  • 35,076
  • 87
  • 265
  • 471
7
votes
5 answers

Android with Kotlin error when use RecyclerView in Fragment

I have error said this: Process: com.example.yudha.kotlinauth, PID: 16435 java.lang.IllegalStateException: video_recyclerview must not be null at…
7
votes
1 answer

Why does oncreateview of the current fragment gets called on pressing the back button?

I am trying to retrieve the fragment from the backstack. It is getting retrieved but the issue is that on pressing the back button the oncreate view and subsequent lifecyce methods of current fragment is also getting called. Here's my code to put…
7
votes
1 answer

android - using same fragment for multiple activities

I want to use a fragment in multiple activities. In the first activity i will use it in, I created it by final ScoreBoard fragment = new ScoreBoard(); getFragmentManager() .beginTransaction() …
7
votes
5 answers

Crash in Marshmallow Fragment Activity for Maps

I am using fragmentActivity for maps.In Java class getting error on setContentView. My Mapscreen.java is like: It is working fine on some devices showing crash on marshmallow only.Or is there any other reason? public class MapScreen extends…
Heena Arora
  • 739
  • 8
  • 18
7
votes
2 answers

How to Add different Activtity in each Tab in Tabbed Activity

I have created tabbed activity and please help me how to show different layouts in different tabs in the swipeable TabLayout. How can we add different activity in each tab for example when we add image in one layout and then swiping screen change…
7
votes
0 answers

AppCompatActivity instead of Activity or FragmentActivity

I've been trying out implementing navigation in android through navigation drawers and swipe views with tabs. I've followed Google's developer tutorials (here and here) and for both situations I could never get my code to work unless I changed…
7
votes
4 answers

How to Hide Map Fragment - Android

Using below code to show and hide MapFragment, and it works just well: public class MapFragmentActivity extends FragmentActivity { ........... mMapFragment = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)); googleMap…
7
votes
4 answers

how to replace one full-screen dialog fragment with another without showing parent activity?

I have an Activity that uses a single custom DialogFragment class. Its appearance is data driven, so it can look fairly different from invocation to invocation. It is "full screen", i.e. setStyle(DialogFragment.STYLE_NO_FRAME,…
7
votes
2 answers

Fragment is recreate on back press from other Fragment

I am facing a problem in regarding fragment. In my scenario, There are two fragment associated with FragmentActivity. In FragmentActivity, there are a container layout (Frame Layout) in which all fragment will replace. public void…
7
votes
3 answers

Access getActivity() inside static method

I have this class here which calls the method setPoint public class PointsList extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the…
heisenberg
  • 1,172
  • 6
  • 14
  • 31