back-stack

Back button closing app even when using FragmentTransaction.addToBackStack()

别等时光非礼了梦想. 提交于 2019-12-18 11:09:59
问题 None of the other questions I have read on stackoverflow have been able to help with my problem. As far as I can tell, I am doing everything correctly. I have a master/detail flow with fragments. Upon creation of the main activity, the master fragment is loaded with the following code: Fragment frag; frag = new MainListFragment();//<-- **the master fragment** FragmentManager fm = getFragmentManager(); FragmentTransaction transaction = fm.beginTransaction(); transaction.replace(R.id.fragment

Android Reorder Fragment Backstack

风流意气都作罢 提交于 2019-12-17 10:48:21
问题 I have a number of pages/fragments listed in my navigation drawer, the user is likely to switch between these frequently and I want them in the backstack so that they can navigate back, but I only want one instance of each fragment in the backstack so that the user doesn't not have to press back an insane number of times to exit the app. I can't figure out how to effectively 'reorder' the backstack' without pages getting removed. Currently when I change page I was using this code to change

How to prevent going back to the previous activity?

荒凉一梦 提交于 2019-12-17 06:21:33
问题 When the BACK button is pressed on the phone, I want to prevent a specific activity from returning to its previous one. Specifically, I have login and sign up screens, both start a new activity called HomeScreen when successful login/signup occurs. Once HomeScreen is started, I want to prevent the users from being able to return to the login or sign up screens by pressing the BACK key. I tried using Intent.FLAG_ACTIVITY_NO_HISTORY , but since the application has Facebook integration, when the

How to prevent going back to the previous activity?

☆樱花仙子☆ 提交于 2019-12-17 06:21:13
问题 When the BACK button is pressed on the phone, I want to prevent a specific activity from returning to its previous one. Specifically, I have login and sign up screens, both start a new activity called HomeScreen when successful login/signup occurs. Once HomeScreen is started, I want to prevent the users from being able to return to the login or sign up screens by pressing the BACK key. I tried using Intent.FLAG_ACTIVITY_NO_HISTORY , but since the application has Facebook integration, when the

How to keep edittexts values after calling another activity than back

天涯浪子 提交于 2019-12-14 03:29:37
问题 I have Activity A with some edittexts and a button .After user populates edittextsin Activity A .Click the button than calling Activity B ( Listview ). User click on listitem and come to back Activity A . My problem is when i come back to Activity A all edittexts are empty. How i can save edittexts values. Tyvm Activity A calls Activity B Intent intent = new Intent(getApplicationContext(), HayvanKartiList.class); intent.putExtra("activityname",BuzagiKayitActivity.class); intent.putExtra(

How to preserve current back stack (or task) when notification is clicked?

断了今生、忘了曾经 提交于 2019-12-14 00:45:03
问题 In my application, I create a notification which starts Details Activity . I want to add this activity to top of current task (or back stack). For example I expect application task (back stack) to behave like this: but I get this: I have not used FLAG_ACTIVITY_CLEAR_TASK and FLAG_ACTIVITY_NEW_TASK flags. What should I do? Edit: First picture is just an example. I think the the question's title is completely explicit. I want to add Details Activity on top of current stack, and not to start

Handle ToggleButton in onResume()

情到浓时终转凉″ 提交于 2019-12-13 08:05:43
问题 I have written a program in which I am using Timer and controlling that timer using Toggle states. Toggle's default state is OFF , once I make changes in toggle state from OFF to ON Timer starts, and when I again change to OFF it stops the Timer as per requirement. But problem starts when my Timer is ON and I switch to other activity and then again come back to ToggleActivity and then do changes in toggle state from ON to OFF - it still runs Timer ... Note: when I use finish() or back press,

Android Activity management

眉间皱痕 提交于 2019-12-13 04:29:02
问题 I have one question in mind for activity management . Suppose I have 4 activities say for example A1,A2,A3,A4. Now A1 have one button which start activity A2. A2 have 2 buttons which start either A3 or A4, A3 have 2 buttons which start activity A4 and A1. A4 have 3 buttons to sart activity A1,A2,A3 I do not use finish method in any of this activity. So now user click any of the activity any of the button than check the activity ,that is this already in back ground? If yes than this activity

Android - What is the best practice for passing back information from an activity without onActivityResult()?

丶灬走出姿态 提交于 2019-12-13 03:53:02
问题 I have a rather general question. Assuming I have a RecyclerView in some kind of a MainActivity . The content of this RecyclerView is being updated in multiple places in other activities. For example there could be the possibility to make new entries by starting a new Activity and saving it there.In that case I would intuitively start that activity with startActivityForResult() and receive the changes in the onActivityResult() method in the MainActivity. But lets say deeper inside the

Android clear ALWAYS the Back Stack

故事扮演 提交于 2019-12-13 01:54:11
问题 There are many question here about this topic, but none of the answers works for me. I am programming an app that will carry sensitive data, and for such reason I want to make the user login each time it enters the app. I already tried the singletask launch mode and clearTaskOnLaunch, also I hide the task from the "Recents Apps" with the exclude from recents attribute. But now the app don't behaves as it should with the Back button. Example: LoginActivity > MainActivity > HelpActivity Now the