dialog - android: Exiting App(Activity) on dialogue box close -


i have activity opens dialogue box sign or log in. want if press button not dialogue box activity should exit. how can achieve this?

use setoncancellistener call finish() when back-key pressed on dialog

//for example new alertdialog.builder(this) .setoncancellistener(new oncancellistener() {      @override     public void oncancel(dialoginterface dialog) {         finish();   //to finish activity on dialog displayed     } }) ... 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -