本文整理匯總了Java中android.support.v7.app.AppCompatActivity.finish方法的典型用法代碼示例。如果您正苦於以下問題:Java AppCompatActivity.finish方法的具體用法?Java AppCompatActivity.finish怎麽用?Java AppCompatActivity.finish使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.app.AppCompatActivity
的用法示例。
在下文中一共展示了AppCompatActivity.finish方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: showIntroDialog
import android.support.v7.app.AppCompatActivity; //導入方法依賴的package包/類
public static void showIntroDialog(final AppCompatActivity activity) {
RadioDialogCallback callback = new RadioDialogCallback() {
@Override
public void which(int position) {
if (position == 0) {
activity.startActivity(IntroActivity.previewIntroInstance(activity));
activity.finish();
} else {
activity.startActivity(IntroActivity.todoListIntroInstance(activity, null, null));
activity.finish();
}
}
};
CharSequence[] items = new CharSequence[]{
getString(activity, R.string.intro_preview),
getString(activity, R.string.intro_todo_list),
};
showRadioDialog(activity, getString(activity, R.string.intro_dialog), items, callback);
}
示例2: closeApplication
import android.support.v7.app.AppCompatActivity; //導入方法依賴的package包/類
public static void closeApplication(AppCompatActivity context) {
Intent intent = new Intent(context, LauncherActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra(AppConstants.EXIT, true);
context.startActivity(intent);
context.finish();
}
示例3: changeToTheme
import android.support.v7.app.AppCompatActivity; //導入方法依賴的package包/類
/**
* Set the theme of the Activity, and restart it by creating a new Activity of the same type.
*/
static void changeToTheme(AppCompatActivity activity, int theme) {
// sTheme = theme;
EyeRS.PREFERENCES.putInteger("theme", theme);
EyeRS.PREFERENCES.flush();
// activity.setTheme(theme);
activity.finish();
activity.startActivity(new Intent(activity, activity.getClass()));
}
示例4: killAll
import android.support.v7.app.AppCompatActivity; //導入方法依賴的package包/類
public void killAll() {
// 複製了一份mActivities 集合Å
List<AppCompatActivity> copy;
synchronized (mActivities) {
copy = new LinkedList<>(mActivities);
}
for (AppCompatActivity activity : copy) {
activity.finish();
}
// 殺死當前的進程
android.os.Process.killProcess(android.os.Process.myPid());
}
示例5: finishAllActivities
import android.support.v7.app.AppCompatActivity; //導入方法依賴的package包/類
public static void finishAllActivities() {
for (AppCompatActivity activity : mActivities) {
activity.finish();
}
}