Exception in onCreateDialog method?
<p>i am getting </p>

<pre><code>09-20 12:42:26.697: ERROR/AndroidRuntime(721): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dashboardnew/com.dashboardnew.GmailFetchActivity}: java.lang.IllegalArgumentException: Activity#onCreateDialog did not create a dialog for id 1
</code></pre>

<p>exception in 2.1 and lower versions.</p>

<pre><code>@Override
protected Dialog onCreateDialog(int id) {

    LayoutInflater factory = LayoutInflater.from(this);

final View textEntryView = factory.inflate(R.layout.alertdialog_gmail, null);

AlertDialog.Builder alert = new AlertDialog.Builder(this); 

alert.setTitle("Gmail login"); 
alert.setMessage("Enter your username and password"); 
// Set an EditText view to get user input  
alert.setView(textEntryView);       

final EditText username = (EditText) textEntryView.findViewById(R.id.edit_username);
final EditText password = (EditText) textEntryView.findViewById(R.id.edit_password);

alert.setPositiveButton("Login", new DialogInterface.OnClickListener() { 
public void onClick(DialogInterface dialog, int whichButton) { 

    String user=username.getText().toString();
    String pass=password.getText().toString();

    new FetchGmail().execute(user+"@gmail.com",pass); 
    progressDialog2.show();


} 
}); 

alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { 
  public void onClick(DialogInterface dialog, int whichButton) { 
    // Canceled. 
  } 
}); 

alert.show(); 


    // TODO Auto-generated method stub
    return super.onCreateDialog(id);


}
</code></pre>
