Note that there are some explanatory texts on larger screens.

plurals
  1. POActivity Still Runs - Android
    primarykey
    data
    text
    <p>I have created a BootReceiver which creates a new activity and popup an Alert Dialog. After pressing OK/Cancel that activity still is not closed completely. I can see the same in Window List button &amp; I can see the Alert dialog from the Window list.</p> <p>Any ideas what might be wrong?</p> <p>My code looks like below , calling finish after OK/Cancel buttoon protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);</p> <pre><code> WindowManager.LayoutParams winParams; getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); // Windows Attributes requestWindowFeature(Window.FEATURE_NO_TITLE); winParams = getWindow().getAttributes(); winParams.flags |= (WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); getWindow().setAttributes(winParams); // Show Popup popup = new AlertDialog.Builder(this) .setCancelable(true) .setPositiveButton("agree", new OnClickListener() { public void onClick(DialogInterface dialog, int arg1) { if( DEBUG ) Log.d(LOG_TAG, " AGREE CLICKED" ); finish();}}) .setNegativeButton("disagree", new OnClickListener() { public void onClick(DialogInterface dialog, int arg1) { if( DEBUG ) Log.d(LOG_TAG, " DISAGREE CLICKED" ); finish();}}) .setOnCancelListener( new DialogInterface.OnCancelListener() { public void onCancel(DialogInterface dialog) { finish(); }}); popup.setIcon(android.R.drawable.ic_dialog_alert); popup.setTitle("title"); popup.setMessage("Message"); dialog = popup.create(); winParams = dialog.getWindow().getAttributes(); winParams.flags |= (WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); dialog.getWindow().setAttributes(winParams); dialog.setOnDismissListener(AlwaysReqWhenPS); dialog.setOnKeyListener(this); dialog.show(); } protected void onStop() { if( DEBUG ) Log.d(LOG_TAG, " OnStop Called" ); super.onStop(); } public void onDestroy() { if( DEBUG ) Log.d(LOG_TAG, " onDestroy Called" ); super.onDestroy(); } public void onPause() { if( DEBUG ) Log.d(LOG_TAG, " onPause Called" ); super.onPause(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload