public final class ActivityHelper extends Object
Modifier and Type | Method and Description |
---|---|
static void |
exit(android.app.Activity self)
Mark this application as stopping and finish the given Activity.
|
static boolean |
exitOnBackKeyDown(android.app.Activity self,
int keyCode,
android.view.KeyEvent event)
|
static void |
restart(android.app.Activity self)
Mark this application as restarting and finish the given Activity.
|
public static void exit(android.app.Activity self)
App
.
getInstance()
.
setStopping
(true)
is called and then finish()
is called
on the given Activity.
BaseXxxActivity
classes can use this method to implement
exit()
method. See the implementation of BaseActivity.exit()
as an example.
public static boolean exitOnBackKeyDown(android.app.Activity self, int keyCode, android.view.KeyEvent event)
exit
(true)
if the given key code is KeyEvent.KEYCODE_BACK
. Otherwise, nothing is done and
false is returned.
BottomXxxActivity
classes can use this method to implement
onKeyDown(int, android.view.KeyEvent)
method.
See the implementation of BottomActivity.onKeyDown(int, KeyEvent)
as an example.
self
- keyCode
- event
- KEYCODE_BACK
.public static void restart(android.app.Activity self)
App
.
getInstance()
.
setRestarting
(true)
is called and then exit
(self)
is called.
BaseXxxActivity
classes can use this method to implement
restart()
method. See the implementation of BaseActivity.restart()
as an example.
Copyright © 2016. All rights reserved.