Wednesday, 15 June 2011

android - How to close an app after showing a dialog? -



android - How to close an app after showing a dialog? -

i have completed app development , have allowed way show toast message if there no net connection. need know how close app after showing dialog if there no net connection?

my app webview app. when user turn on app, app must check net connection. , display dialog box if no network , app must close after showing dialog.

or

i don't want users see "webpage not available" page, if there no net connection, app must close after showing dialog box 1 button 'close'. or there way redirect users text in directory shows no net connection?

i need code only; other codes have been done , working properly.

just invoke finish() destroy activity in onclick() function of dialog. like:

... builder.setmessage('there no connection!! please close activity!') .setpositivebutton('close', new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { finish(); } }) ...

android dialog internet-connection

No comments:

Post a Comment