FileDocCategorySizeDatePackage
AppNotRespondingDialog.javaAPI DocAndroid 1.5 API3833Wed May 06 22:42:00 BST 2009com.android.server.am

AppNotRespondingDialog

public class AppNotRespondingDialog extends BaseErrorDialog

Fields Summary
private final ActivityManagerService
mService
private final ProcessRecord
mProc
private final android.os.Handler
mHandler
Constructors Summary
public AppNotRespondingDialog(ActivityManagerService service, android.content.Context context, ProcessRecord app, HistoryRecord activity)

        super(context);
        
        mService = service;
        mProc = app;
        Resources res = context.getResources();
        
        setCancelable(false);

        int resid;
        CharSequence name1 = activity != null
                ? activity.info.loadLabel(context.getPackageManager())
                : null;
        CharSequence name2 = null;
        if ((app.pkgList.size() == 1) &&
                (name2=context.getPackageManager().getApplicationLabel(app.info)) != null) {
            if (name1 != null) {
                resid = com.android.internal.R.string.anr_activity_application;
            } else {
                name1 = name2;
                name2 = app.processName;
                resid = com.android.internal.R.string.anr_application_process;
            }
        } else {
            if (name1 != null) {
                name2 = app.processName;
                resid = com.android.internal.R.string.anr_activity_process;
            } else {
                name1 = app.processName;
                resid = com.android.internal.R.string.anr_process;
            }
        }

        setMessage(name2 != null
                ? res.getString(resid, name1.toString(), name2.toString())
                : res.getString(resid, name1.toString()));

        setButton(res.getText(com.android.internal.R.string.force_close),
                mHandler.obtainMessage(1));
        setButton2(res.getText(com.android.internal.R.string.wait),
                mHandler.obtainMessage(2));
        setTitle(res.getText(com.android.internal.R.string.anr_title));
        getWindow().addFlags(FLAG_SYSTEM_ERROR);
        getWindow().setTitle("Application Not Responding: " + app.info.processName);
    
Methods Summary
public voidonStop()