FileDocCategorySizeDatePackage
BaseErrorDialog.javaAPI DocAndroid 5.1 API2798Thu Mar 12 22:22:42 GMT 2015com.android.server.am

BaseErrorDialog

public class BaseErrorDialog extends android.app.AlertDialog

Fields Summary
private static final int
ENABLE_BUTTONS
private static final int
DISABLE_BUTTONS
private boolean
mConsuming
private android.os.Handler
mHandler
Constructors Summary
public BaseErrorDialog(android.content.Context context)


       
        super(context, com.android.internal.R.style.Theme_Dialog_AppError);

        getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
                WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
        WindowManager.LayoutParams attrs = getWindow().getAttributes();
        attrs.setTitle("Error Dialog");
        getWindow().setAttributes(attrs);
    
Methods Summary
public booleandispatchKeyEvent(android.view.KeyEvent event)

        if (mConsuming) {
            //Slog.i(TAG, "Consuming: " + event);
            return true;
        }
        //Slog.i(TAG, "Dispatching: " + event);
        return super.dispatchKeyEvent(event);
    
public voidonStart()

        super.onStart();
        mHandler.sendEmptyMessage(DISABLE_BUTTONS);
        mHandler.sendMessageDelayed(mHandler.obtainMessage(ENABLE_BUTTONS), 1000);
    
private voidsetEnabled(boolean enabled)

        Button b = (Button)findViewById(R.id.button1);
        if (b != null) {
            b.setEnabled(enabled);
        }
        b = (Button)findViewById(R.id.button2);
        if (b != null) {
            b.setEnabled(enabled);
        }
        b = (Button)findViewById(R.id.button3);
        if (b != null) {
            b.setEnabled(enabled);
        }