当前位置: 首页>>代码示例>>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;未经允许,请勿转载。