how to join two table in codeigniter easily[updated] | ci_model | ci_controller | codeigniter 3 -datainflow
Exit application using permission: If you want to exit application and show a dialog box for exit permission in your Android Application. An android application, when you want to close or exit, before exit the application it will show the user confirm alert dialog box.
If user click ‘yes’ then it close and click ‘no’ then the dialog box is cancel and exist the same position. Follow this code:
Example:
if(id == R.id.app_exit) { new AlertDialog.Builder(this) .setTitle("Close App?") .setMessage("Do you really want to close this app?") .setPositiveButton("YES", new DialogInterface.OnClickListener() { <a class="ap-mention-link" href="http://datainflow.com/user/Override">@Override</a> public void onClick(DialogInterface dialog, int which) { android.os.Process.killProcess(android.os.Process.myPid()); } }) .setNegativeButton("NO", new DialogInterface.OnClickListener() { <a class="ap-mention-link" href="http://datainflow.com/user/Override">@Override</a> public void onClick(DialogInterface dialog, int which) { } }).show(); }
Use this code in your Android Studio project. If you faced any problem then comment me.
Related posts