Not finish the activity use theme dialog
<p>here is my code</p>

<pre><code>@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AlertOn();
    }

    private void AlertOn() {    
         alertbox = new AlertDialog.Builder(this).create();
        alertbox.setIcon(R.drawable.icon);
        alertbox.setTitle(getIntent().getStringExtra("Title"));
        alertbox.setMessage(getIntent().getStringExtra("Message"));
        alertbox.setButton("Ok", new DialogInterface.OnClickListener() {
            public void onClick(final DialogInterface dialog, int arg1) {               
                dialog.dismiss();
                Intent startActivity = new Intent(); 
                startActivity.setClass(getApplicationContext(), moontech.fax.mFax.class); 
                startActivity.setAction(NotificationAlert.class.getName()); 
                startActivity.setFlags( 
                        Intent.FLAG_ACTIVITY_NEW_TASK 
                        | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);      
                 startActivity(startActivity);
                 finish();
            }
        });

        alertbox.show();        
    }
</code></pre>

<p>and in manifeast file declare</p>

<pre><code>&lt;activity android:name="com.demo.notificationalert"
            android:theme="@android:style/Theme.Dialog" 
            android:screenOrientation="portrait" /&gt;
</code></pre>

<p>but when display dialog and without press ok i use back from device then that activity not finished.</p>
