back

Back button in iphone app

ぐ巨炮叔叔 提交于 2019-11-28 12:27:44
问题 I have a simple single View application with a button in the main view which sends me off to another view with an independent xib file. On this second view I have a button that should send me back to the main view. I'm not using a navigation controller. Can anyone tell me how to program this "back" button so it will display the main view again? Thanks so much in advance. 回答1: If you called the second viewcontroller like this: [self presentModalViewController:secondViewController animated:YES]

When I return back to my Activity onCreate is raised instead of onActivityResult?

一世执手 提交于 2019-11-28 12:03:47
问题 I have an Activity that opens a new Activity for result like this: Intent i = new Intent(ActDocument.this, ActCustomers.class); startActivityForResult(i, ActDocument.DIALOG_CUSTOMER); when I press back in the child Activity and return back to the parent Activity onActivityResult is called in all of devices correctly but I have fount a device that onCreate is called instead of onActivityResult . This device is Samsung Galaxy Tab-P5100 Android 4.0.3. It is strange that I have tested my

EditText does not trigger changes when back is pressed

和自甴很熟 提交于 2019-11-28 10:55:41
问题 In an application with shopping cart, I give the option to change the amount of items via an EditText which allows only numerical input. Everything works fine, except when the user changes the field and then presses the back key to hide the soft keyboard. In this case, the field shows the changed value, but I don't know how I can detect this change and react on it. Waiting for a switch to another activity is not an option. When the user confirms with "done" button, I can handle this with a

How to Control Android back stack

痴心易碎 提交于 2019-11-28 10:24:00
Lets say I have A->B->C->D->E In android back stack. I want to be able to get back to one of the following: A->B->C A->B A How can I achieve this? Hopefully without forcing back button clicks. Using the image and information from the official developers page on Android tasks and back stack you can see that of all other ways to launch an Activity you can ensure such behavior only using the FLAG_ACTIVITY_CLEAR_TOP in your Intent flags. Your regular back button proceeds as: But when you specify this flag, you get a behavior like you need, as given by an example at this source : consider a task

Change browser back button behaviour for my web app?

拟墨画扇 提交于 2019-11-28 07:45:58
问题 Im making an 'app like' web page. The actual page is wider than the browser viewport which has its overflow hidden. Clicking different links changes the CSS to animate to different sections. Here is a very simple demo: http://smartpeopletalkfast.co.uk/pos/ At this stage im working on a demo, not a production site. I want to intercept the browser back button, so if you've navigated to a section, you would be taken back to the previous section rather than leaving the web page. In a perfect

OnBackPressed in Xamarin Android

余生长醉 提交于 2019-11-28 07:35:18
问题 I have: public override void OnBackPressed () { base.OnBackPressed (); } How can I get previous state of my app? Does Xamarin have such as BackStackEntryCount, how can I use it? For example I click MainMenu->Study->Categories->FirstCategory, if I click Back, I want to have Categories. 回答1: If the Categories activity precedes the Selected category in the activity stack and is not flagged for no history OnbackPressed without override of the base/super class will take you back to the categories

Android - Confirm app exit with toast

不问归期 提交于 2019-11-28 07:02:31
I'm new to Android development and I want it so when the user presses the back button on the main activity, a toast message appears with a "confirm exit by pressing the back button again" message. How would I do this? This is what I have so far: @Override public void onBackPressed() { // TODO Auto-generated method stub super.onBackPressed(); Toast s = Toast.makeText(getBaseContext(), "Press back again to exit", Toast.LENGTH_LONG); s.show(); wait(); public boolean onBackPressed() { finish(); } } I would just save the time of the backpress and then compare the time of the latest press to the new

Android - How to animate an activity transition when the default back button is pressed

試著忘記壹切 提交于 2019-11-28 06:43:58
In my activity, I have a button with the following click listener that is working great: final ImageButton startOverButton = (ImageButton) findViewById(R.id.start_over_button); startOverButton.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(final View v) { finish();//go back to the previous Activity overridePendingTransition(R.anim.comming_in, R.anim.comming_out); } }); It animates the return to the previous activity the way I want. However, when the user presses the Android default back button, the animation is not triggered. My question is: where should I put the

Problems To Cancel A CountDownTimer Android Java

拜拜、爱过 提交于 2019-11-28 03:30:39
问题 When I close my app by pressing the BACK button (onBackPressed() called), the CountDownTimer doesn't stop, until it is done with counting. How can I put the CountDownTimer cancel(); in my onBackPressed() ? Because, when I quit my application (shown below with descriptions) I don't want counter toasts on my screen anymore. On top of my code: boolean network_connected = false; What's in my onCreate() : if (check_network.isInternetAvailable(this)) { network_connected = true; new connect_task

How to disable back gesture in iOS 7 for only one view

不问归期 提交于 2019-11-28 01:14:34
问题 I am trying to disable the back gesture for my view controller using the following set of code. In FirstViewController.m , I'm setting the delegate of interactivePopGestureRecognizer - (void) viewWillLoad { // Other stuff.. self.navigationController.interactivePopGestureRecognizer.delegate = self; } And then implementing the <UIGestureRecognizerDelegate> method and returning NO . - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { return NO