本文整理汇总了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();
}
}