back-stack

How to finish an activity and return to a varied location?

蓝咒 提交于 2019-12-11 03:45:37
问题 My application implements an action which stretch upon 3-4 activities. the entry point to this process can be from different activities in the application. (HomeActivity, various displayActivities). I want to return to the starting activity once the last activity is finished successfully. Is there a best practice way to do it? thankyou. 回答1: You can use a global static boolean to help you with this (in the example SomeClass.IsClosingFlow ), Plus, you should define each activity to "mark" if

Maximum BackStack size in android

天大地大妈咪最大 提交于 2019-12-11 02:22:21
问题 I'm a new one to android development. I need to know the Maximum memory Size of BackStack in android And i want to know How many activities of Android Application can be stored in BackStack Thanks 回答1: The maximum memory size of your back stack is the same as the amount of free memory on your device. You can keep throwing things on the activity stack until you get an OutOfMemoryException. Check this 来源: https://stackoverflow.com/questions/16211279/maximum-backstack-size-in-android

Nested Fragment with backstack Resume

China☆狼群 提交于 2019-12-10 20:16:26
问题 In my application there are several fragment s in an activity and I am maintaining a backStack for these fragment . Everything is okay, but there is a nested fragment among them. When I put it into backStack and again resume in by pressing back button, the fragment looks overllaping previous content (child fragment). This is the normal view: This is the screenshot of overlapping view (when I resume the fragment): You can get the difference as the second one's text is more deep (that means

How does NavUtils.navigateUpFromSameTask work?

左心房为你撑大大i 提交于 2019-12-10 15:26:20
问题 please what is actuall behavior of this method? I thought that when bind this method call to my actionbar back button and also set the homepageactivity name in Manifest.xml, it should be then opened after the click in the button - regardless of the current task stack.. For example, when I open my Activity from widget, the parent Activity is not in BackStack - this is what I want to solve..I know I can somehow build my own taskstack, but I just thought, that this should be prebaked solution,

How to Restart the app in android marshmallow when permission changed manually

天涯浪子 提交于 2019-12-10 12:13:13
问题 I have an android application which was supporting till lollipop. Now I'm migrating it to support Marshmallow. I am stuck in a case where if we manually changed the app permission in marshmallow it kills all the process. I get it as explained by @CommonsWare in similar question here. But in my case I have to kill the app and need to restart the app. Because my app each activity is dependent on previous activity some data is shared. I just need to know when we manually change the permission is

Android onConfigurationChanged: how to save and restore fragment back stack?

六月ゝ 毕业季﹏ 提交于 2019-12-10 03:31:59
问题 I have an activity with a dual pane: a list of menu items on the left (fragment M) and details of the currently selected item on the right (fragment D). When the user selects an item in fragment D, fragment D gets replaced with another fragment (let's call it D1). When the user selects an item in fragment D1, fragment D1 gets replaced with another fragment (let's call it D2), and so on. Of course, when the user presses the back button she can go back in the fragments history: D2->D1->D. My

How to handle back button using view pager?

拟墨画扇 提交于 2019-12-10 03:14:52
问题 I am having two fragments Frag A and Frag B which are rendered using view pager . If user has swiped from A to B then presses back button(when in B) then user should go to A instead of coming out of view pager . How can we achieve this ? Adding transaction to backstack does not seem to help . Thanks 回答1: You have to override the onKeyDown() method in the Activity . @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { myViewPager

How can I save the application back stack to a bundle?

倾然丶 夕夏残阳落幕 提交于 2019-12-09 12:56:02
问题 I'd like to save the state of my application so that when it is reopened from a closed state, the last fragment is visible and the back stack is preserved. I'd like to preserve this state every time the application is closed, not just on an orientation change or when the system kills the app to free up resources (as is the case when using onSaveInstanceState() / onRestoreInstanceState() . So far I've been able to restore the previous fragment and its state as planned by saving the state to

Maintaining standard application Activity back stack state in Android (using singleTask launch mode)

六月ゝ 毕业季﹏ 提交于 2019-12-09 00:42:56
问题 I am having trouble finding out how to maintain the state of my Android app in development. Just to clarify, I am not talking about maintaining activity state (i.e. keeping track of textbox values, checkboxes, etc on a specific activity). Let's say for example my application has two activities A and B . When I start my app, it takes me to activity A , and pressing a button on it takes me to activity B . At this point, I press the home button on my phone to return to the main Android UI and

how to show hide a fragment?

守給你的承諾、 提交于 2019-12-08 08:03:55
问题 I have a Activity with four buttons at the bottom like tabs. By pressing any button a new Fragment is displayed in the FrameLayout above these buttons like we do in TabActivity. See My Problem here .Now i think i should find a way to hide and show those fragments. Kindly tell me how can i show and hide a fragment without reloading it again. Main Purpose of showing hiding a fragment is to maintain its current state. In one of my fragment i have an AsyncTask whenever i switch between fragment