back

Android make view disappear by clicking outside of it

佐手、 提交于 2019-11-29 22:55:25
I have some views that I make visible upon a button press. I want them to disappear if I click outside of those views. How would this be done on Android? Also, I realize that the "back button" can also assist Android users with this - I might use that as a secondary way to close the views - but some of the tablets aren't even using a 'physical' back button anymore, it has been very de-emphasized. An easy/stupid way: Create a dummy empty view (let's say ImageView with no source), make it fill parent If it is clicked, then do what you want to do. You need to have the root tag in your XML file to

Disable browser back button for one page application

陌路散爱 提交于 2019-11-29 21:42:45
问题 I need to disable the back button of browser in my single page application. I tried using methods like onhashchange or window.history.forward but they don't work (reason may be that url doesn't get changed here) Please help! Thanks. 回答1: I work in AngularJS building a Single Page App and I wanted to disable or prevent the back button of the browser, because my app has buttons and anchors for all navegation into my app. I searched and test many codes, and this is the easy to prevent the back

Back button in iphone app

拈花ヽ惹草 提交于 2019-11-29 18:12:38
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. If you called the second viewcontroller like this: [self presentModalViewController:secondViewController animated:YES]; You can dismiss it like this: [self dismissModalViewControllerAnimated:YES]; You may want to consider

EditText does not trigger changes when back is pressed

半腔热情 提交于 2019-11-29 17:12:53
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 "OnEditorActionListener". But what about the back key? update: As it turned out, neither onKeyDown /

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

流过昼夜 提交于 2019-11-29 17:01:20
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 application on other devices of Samsung Galaxy Tab-P5100 Android 4.0.3 and it was OK but I have problem only in

Using the BACK button to revert to the previous state of the page

╄→尐↘猪︶ㄣ 提交于 2019-11-29 14:19:13
I am trying a new functionality for my web site. I want to do simple navigation by hiding/showing <div> elements. For example, when a user clicks a "details" button on some product, I want to hide the main <div> and show the <div> containing the details for the product. The problem is that to go back to the previous "page", I have to undo all the display/visibility style changes, which is ok if the user clicks the "close" button in the newly opened <div> . But most users will hit the BACK button. Is there a way to make the BACK button go back to the previous "state" of the page i.e., undo the

Change browser back button behaviour for my web app?

爱⌒轻易说出口 提交于 2019-11-29 13:57:06
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 world this would happen with the same animations ive used for navigating to sections. Can this be achieved?

OnBackPressed in Xamarin Android

本小妞迷上赌 提交于 2019-11-29 13:44:56
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. 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 class and hit the OnResume method. If you loaded your Categories activity in OnCreate and dont do anything

Problems To Cancel A CountDownTimer Android Java

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 10:18:24
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_main().execute(""); } else { network_connected = false; } if (network_connected == false) { new

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

自古美人都是妖i 提交于 2019-11-29 07:34:47
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; } And in dealloc I'm setting the delegate to nil. (I have read somewhere that in iOS 7, you have to