johannilsson / android-actionbar

DEPRECATED Android Action Bar Implementation
1.3k stars 564 forks source link

How to add exit action? #84

Open cyclonmaster-zz opened 9 years ago

cyclonmaster-zz commented 9 years ago

There are several action to accomplish this such as:

finish(); System.exit(0);

or call separate function with dialog like private void openQuitDialog(){ .... }

But, I do not know how to implement it using this library. This is my code:

final Action exitAction = new IntentAction(this, HomeActivity.finish(this), R.drawable.ic_menu_exit); actionBar.addAction(exitAction);

Please advice. Sorry that I still need to use this library at this moment.