starting an activity from onCreate or onStart
<p>I have an activity that is themed as Theme.Dialog.  I want to have this activity started off the main activity during the latter's onCreate or onStart (depending on some conditions that are checked first).  My problem is that when the "dialog" activity is started this way it doesn't display.  I get a blank activity.</p>

<p>Manifest snippet:</p>

<pre><code> &lt;activity android:name="CredentialsDialog"
        android:label="Credentials"
        android:theme="@android:style/Theme.Dialog"&gt; 
 &lt;/activity&gt;
</code></pre>

<p>Dialog layout:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:padding="25dp"
  android:gravity="center_vertical|center_horizontal"&gt;

    &lt;EditText android:id="@+id/txt_username"
        android:hint="Your username"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"&gt;
    &lt;/EditText&gt;
    &lt;EditText android:id="@+id/txt_password"
        android:hint="Your password"
        android:password="true"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"&gt;
    &lt;/EditText&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>CredentialsDialog snippet:</p>

<pre><code>public class CredentialsDialog extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {       
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_LEFT_ICON);
        setContentView(R.layout.credentials_dialog);
        getWindow().setTitle("This is just a test");
        getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, android.R.drawable.ic_dialog_alert);

        Bundle extras = getIntent().getExtras();
        String user = extras.getString("user");
        String pass = extras.getString("pass");

        // get handle on EditText fields
        final EditText textUser = (EditText) findViewById(R.id.txt_username);
        final EditText textPass = (EditText) findViewById(R.id.txt_password);

        // pre-populate dialog username EditText with username if it exists
        if (user != "") {
            textUser.setText(user);
        }

        // pre-populate dialog password EditText with password if it exists
        if (pass != "") {
            textPass.setText(pass);
        }
    }
}
</code></pre>

<p>MainActivity snippet:</p>

<pre><code>(in either onCreate or onStart)
    if (!loginData()) {
        loginDialog();
    } else {    
        bLoggedIn = qrzLogin();
        toggleUi();
    }
(snip...)
    public void loginDialog() {
        Intent i = new Intent(this, CredentialsDialog.class);
        i.putExtra("user", MainActivity.user);
        i.putExtra("pass", MainActivity.pass);
        startActivity(i);
    }
</code></pre>

<p>In MainActivity, if I called loginDialog() a second time immediately after the first, the second would work while the first would be a blank activity.  What am I doing wrong? Opinions welcome too. :)</p>

<p>Thanks,
Doug</p>
