本文整理匯總了Java中android.app.Activity.isFinishing方法的典型用法代碼示例。如果您正苦於以下問題:Java Activity.isFinishing方法的具體用法?Java Activity.isFinishing怎麽用?Java Activity.isFinishing使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.app.Activity
的用法示例。
在下文中一共展示了Activity.isFinishing方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: call
import android.app.Activity; //導入方法依賴的package包/類
public static void call(Activity activity, String messageId, OnClickListener yes, OnClickListener no) {
if (activity != null) {
Dialog dialog = new Builder(activity).setIcon(R.drawable.dialog_icon).setMessage(messageId).setPositiveButton(R.string.dialog_default_ok, yes).setNegativeButton(R.string.dialog_default_no, no).create();
if (!activity.isFinishing() && !activity.isRestricted()) {
try {
dialog.show();
} catch (Exception e) {
}
}
}
}
示例2: showDialog
import android.app.Activity; //導入方法依賴的package包/類
public static void showDialog(Activity context, CharSequence title, CharSequence centerText, OnClickListener centerListener) {
if (mCommonDialog != null && mCommonDialog.isShowing()) {
mCommonDialog.dismiss();
}
mCommonDialog = new CommonDialog(context);
mCommonDialog.setTitle(title);
mCommonDialog.setButtonText(centerText);
if (centerListener != null) {
mCommonDialog.setCenterOnClickListener(centerListener);
}
if (!context.isFinishing() && !context.isRestricted()) {
try {
mCommonDialog.show();
} catch (Exception e) {
}
}
}
示例3: onActivityStopped
import android.app.Activity; //導入方法依賴的package包/類
@Override
public void onActivityStopped(Activity activity) {
WebtrekkLogging.log("Tracking Activity stopped: " + getActivityName(activity) + " instance hash:" + activity.hashCode() + (activity.isFinishing() ? " as finishing" : " as sleeping"));
WebtrekkLogging.log("CurrentStatus before:"+mCurrentStatus+ " Current Activity:"+mCurrentActivityName + " Previous Activity:"+mPreviousActivitiesQueue.peek());
if (activity.isFinishing()) {
//activity is finishing increase activity counter and determine applicaiton shut down
mCurrentActivitiesCount--;
if (mCurrentActivitiesCount == 0 || (mFirstActivityName != null && mFirstActivityName.equals(getActivityName(activity))))
mCurrentStatus = STATUS.SHUT_DOWNING;
}else
{
// if this is not finishing activity and there is no any new activity started that is go to background process
String stoppedActivity = getActivityName(activity);
if (stoppedActivity.equals(mCurrentActivityName) && !activity.isChangingConfigurations() && (mCurrentActivityInstance == null || activity == mCurrentActivityInstance.get()))
{
mCurrentStatus = STATUS.GOING_TO_BACKGROUND;
mLastActivityVisibleTime = System.currentTimeMillis();
}
}
WebtrekkLogging.log("CurrentStatus after:"+mCurrentStatus + " Current Activity:"+mCurrentActivityName + " Previous Activity:"+mPreviousActivitiesQueue.peek());
}
示例4: finishAllActivity
import android.app.Activity; //導入方法依賴的package包/類
/**
* 移除所有的activity(通常會在一鍵退出的時候使用)
*/
public void finishAllActivity(){
for (Activity activity : activityList){
if(!activity.isFinishing()){
activity.finish();
}
}
activityList.clear();
android.os.Process.killProcess(android.os.Process.myPid());
}
示例5: isSafe
import android.app.Activity; //導入方法依賴的package包/類
/**
* 檢查activity是否安全
*/
public static boolean isSafe(Activity activity) {
if (activity == null || activity.isFinishing() || activity.isDestroyed()) {
return false;
}
return true;
}
示例6: finishActivity
import android.app.Activity; //導入方法依賴的package包/類
/**
* 結束指定的Activity
*/
public void finishActivity(Activity activity) {
if (activity != null && !activity.isFinishing()) {
activityStack.remove(activity);
activity.finish();
activity = null;
}
}
示例7: call
import android.app.Activity; //導入方法依賴的package包/類
public static void call(Activity activity, int messageId, OnClickListener yes, OnClickListener no) {
if (activity != null) {
Dialog dialog = new Builder(activity).setTitle(2131100003).setIcon(2130837921).setMessage(messageId).setPositiveButton(2131100002, yes).setNegativeButton(2131100001, no).create();
if (!activity.isFinishing() && !activity.isRestricted()) {
try {
dialog.show();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
示例8: call
import android.app.Activity; //導入方法依賴的package包/類
public static void call(Activity activity, int title, int messageId, int yes, OnClickListener yesListener, boolean cancelable) {
if (activity != null) {
Dialog dialog = new Builder(activity).setTitle(title).setIcon(R.drawable.dialog_icon).setMessage(messageId).setCancelable(cancelable).setPositiveButton(yes, yesListener).create();
if (!activity.isFinishing() && !activity.isRestricted()) {
dialog.show();
}
}
}
示例9: removeAll
import android.app.Activity; //導入方法依賴的package包/類
public void removeAll() {
if (!this.mActivityMap.isEmpty()) {
for (String key : this.mActivityMap.keySet()) {
Activity activity = (Activity) this.mActivityMap.get(key);
if (!(activity == null || activity.isFinishing())) {
activity.finish();
}
}
}
this.mActivityMap.clear();
}
示例10: finishAll
import android.app.Activity; //導入方法依賴的package包/類
public synchronized void finishAll() {
for (Activity a : createdActivities) {
if (!a.isFinishing()) {
a.finish();
}
}
createdActivities.clear();
}
示例11: obtain
import android.app.Activity; //導入方法依賴的package包/類
public static synchronized RemoteActivityManager obtain(Activity parent){
if(parent.isFinishing()){
throw new IllegalStateException("this activity has been finished : "+parent.toString());
}
if(sActivityManager.get(parent)==null){
RemoteActivityManager activityManager = new RemoteActivityManager(parent);
sActivityManager.put(parent,activityManager);
}
return sActivityManager.get(parent);
}
示例12: finishAll
import android.app.Activity; //導入方法依賴的package包/類
public static void finishAll()
{
for(Activity activity:activities)
{
if(!activity.isFinishing())
{
activity.finish();
}
}
}
示例13: finishActivity
import android.app.Activity; //導入方法依賴的package包/類
/**
* 結束指定的Activity
*/
public void finishActivity(Activity activity) {
if (activity != null && !activity.isFinishing()) {
mActivityStack.remove(activity);
activity.finish();
}
}
示例14: update
import android.app.Activity; //導入方法依賴的package包/類
@Override
public void update(Observable observable, Object o) {
Activity activity = getActivity();
if (activity == null || activity.isFinishing()) {
return;
}
mChapters.clear();
if (o instanceof IChapterProvider) {
//noinspection unchecked
mChapters.addAll(((IChapterProvider)o).getChapters());
mRecyclerView.setAdapter(new NumberSelectionAdapter(mChapters.size(), CurrentSelected.getChapter() == null || CurrentSelected.getChapter().getId() == null ? null : Integer.parseInt(CurrentSelected.getChapter().getId()), this));
}
}
示例15: finishAll
import android.app.Activity; //導入方法依賴的package包/類
public static void finishAll(){
for(Activity activity:activities){
if(!activity.isFinishing())
activity.finish();
}
}