back

Android: avoid calling onCreate() when back from another activity

霸气de小男生 提交于 2019-12-11 00:40:16
问题 Assume my application contains two activity, A and B. Both are limited to portrait in AndroidManifest. Activity A started Activity B. In Activity B, there is a button, which calls finish() when clicked. The problem is... When I hold the device vertically(portrait) and click the button, the calling sequence is B.onStop(); B.onDestory(); A.onStart(); However, when I hold the device horizontally(landscape), the sequence becomes B.onStop(); B.onDestory(); A.onCreate(); A.onStart(); I do NOT want

How to detect if a user has gone to a page by using the (browser) back button?

99封情书 提交于 2019-12-10 21:25:40
问题 I have some pages with dynamic generated partial views, for example in some search pages. If a user returned to such pages with the browser back button or with a back button implemented like: @if (Request.UrlReferrer != null) { <button onclick="history.go(-1); return false;" class="flatButtonSecondary">back</button> } He doesn´t get the dynamic generated inputs loaded from the session or cookies because the page becomes loaded out of the cache of the browser. I found this similar thread: How

checkbox/backbutton issue depending on the browser

孤街醉人 提交于 2019-12-10 19:22:15
问题 I've implemented a website in .jsp / JSTL / EL that works fine. However, depending on the browser (!), the behavior of the back button is varying a bit. I did take care to not have double post (so that the browser does not warn the user that he's going to post again) but then apparently this leads to another issue: if I use the back button from Chrome, then the value of the checkboxes aren't correct. Here's the scenario as I understand it: user is on page /page1 then checks a checkbox a POST

PHP - Session_Destroy upon pressing Back button

﹥>﹥吖頭↗ 提交于 2019-12-10 15:28:41
问题 Here is my issue: I have a login page called login.php (containing no HTML code). When the user types in his credentials correctly he's redirected to a specific page; we'll say test.php for this example. The only links on that page logout of the current session, and return the user to index.html. My problem is that if the user presses the back button, it goes back to login.php and you get a blank page. If you navigate away from that blank page you have no way to get back to test.php thus no

Control press “back button” and disable close the application using a dialog for confirm - wp7

China☆狼群 提交于 2019-12-10 14:55:08
问题 I need show a simple dialog with the question : 'Do you want to exit the application?' YES or NO. This dialog will be shown when the user presses the back button of the device. I know how I can show this dialog , but I don't know how to disable the back action: close app. It's always closed. 回答1: If I understand you correctly, you want to display a confirmation dialog when the user clicks the back button on the main page of your app to ask whether they really want to exit. If the user selects

Android: How to simulate back button

为君一笑 提交于 2019-12-10 13:26:50
问题 Currently my activity allows users to fill up certain data. Including spinner etc. When user click next system navigates to another screen. When I press back button on the phone previous activity loaded and filled data is available. My requirement asks me to give a soft "Back" button in the UI. When user clicks it it navigats back to previous screen but the filled data is not available. Is there any way to simulate the back button on a soft UI button onclick event?? Intent back = new Intent

Navigation Controller Back button to go to the screen before the previous screen

左心房为你撑大大i 提交于 2019-12-10 13:09:34
问题 I'm wondering whether it's possible to go back to 2 previous page using navigation controller button. Right now, I've custom made the button using this code self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:mainLib.navCountryTitle style:UIBarButtonItemStyleBordered target:self action:@selector(handleBack:)]; And on 'handleback' method, I called this line [self.navigationController popViewControllerAnimated:YES]; So in this case it will go to the previous screen.

Bring task to front on widget click

落花浮王杯 提交于 2019-12-09 23:46:05
问题 I sent a task (activity) to back with: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); moveTaskToBack(true); } but I need bring it to front by setOnClickPendingIntent in widget. 回答1: Just start the main (root) activity of your application like this: Intent intent = new Intent(context, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); If the

What is the equivalent to “OnBackKeyPress”

拥有回忆 提交于 2019-12-09 17:53:36
问题 In Windows Phone 8.0 I used this to handle the back button: protected override void OnBackKeyPress(CancelEventArgs e) { base.OnBackKeyPress(e); } This Event does not exists on the "Page" control. How can I handle a click on the back button in WP 8.1? 回答1: Take a look at Windows.Phone.UI.Input.HardwareButtons. If you add a Basic Page to your project then VS will add a NavigationHelper class to your project which helps with Navigating thru your App, you can also see in the source code that it

iPhone UIWebView loadHtmlString not added to history

白昼怎懂夜的黑 提交于 2019-12-09 16:12:17
问题 My UIWebview loads a local html file using loadHtmlString. The loaded page has links to other local html files as well as real links that use the internet. I have added a back button with: if ([self.webView canGoBack]) [self.webView goBack]; This works fine except it does not recognise the original page loaded with loadHtmlString. For example, if I navigate: local -> local -> web local X local <- web (The first back works, the next does nothing.) How can I get the webview to recognise the