當前位置: 首頁>>代碼示例>>Java>>正文


Java Activity.isFinishing方法代碼示例

本文整理匯總了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) {
            }
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:12,代碼來源:DialogUtil.java

示例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) {
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:18,代碼來源:DialogUtil.java

示例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());
}
 
開發者ID:Webtrekk,項目名稱:webtrekk-android-sdk,代碼行數:22,代碼來源:ActivityTrackingStatus.java

示例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());

}
 
開發者ID:organizationAllink,項目名稱:wzyx-android-user,代碼行數:14,代碼來源:WzyxApplication.java

示例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;
}
 
開發者ID:wzc25151,項目名稱:lrs_android,代碼行數:10,代碼來源:AppUtil.java

示例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;
    }
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:11,代碼來源:AppManager.java

示例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();
            }
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:13,代碼來源:UIs.java

示例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();
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:9,代碼來源:DialogUtil.java

示例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();
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:12,代碼來源:ActivityUtils.java

示例10: finishAll

import android.app.Activity; //導入方法依賴的package包/類
public synchronized void finishAll() {
    for (Activity a : createdActivities) {
        if (!a.isFinishing()) {
            a.finish();
        }
    }
    createdActivities.clear();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:ActivityManager.java

示例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);
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:11,代碼來源:RemoteActivityManager.java

示例12: finishAll

import android.app.Activity; //導入方法依賴的package包/類
public static void finishAll()
{
    for(Activity activity:activities)
    {
        if(!activity.isFinishing())
        {
            activity.finish();
        }
    }
}
 
開發者ID:dufangyu1990,項目名稱:LeCatApp,代碼行數:11,代碼來源:ActivityControl.java

示例13: finishActivity

import android.app.Activity; //導入方法依賴的package包/類
/**
 * 結束指定的Activity
 */
public void finishActivity(Activity activity) {
    if (activity != null && !activity.isFinishing()) {
        mActivityStack.remove(activity);
        activity.finish();
    }
}
 
開發者ID:z-chu,項目名稱:FriendBook,代碼行數:10,代碼來源:AppManager.java

示例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));
    }
}
 
開發者ID:barnhill,項目名稱:SimpleBible,代碼行數:15,代碼來源:ChapterSelectionFragment.java

示例15: finishAll

import android.app.Activity; //導入方法依賴的package包/類
public  static void finishAll(){
    for(Activity activity:activities){
        if(!activity.isFinishing())
            activity.finish();
    }
}
 
開發者ID:MoonRiser,項目名稱:MaterialLearning,代碼行數:7,代碼來源:ActivityCollector.java


注:本文中的android.app.Activity.isFinishing方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。