Hello everybody,
i just begin with the SDK so I play around but I'm stuck with a really
simple Dialog.show() ...
It maybe is because it'es really late or something but here my code :
public class entry extends Activity {
static final int CREATE_DIALOG = 0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.entry);
}
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_bottom, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.create:
this.showDialog(CREATE_DIALOG);
return true;
}
return false;
}
protected Dialog onCreateDialog(int id) {
Dialog dialog;
switch(id) {
case CREATE_DIALOG:
dialog = new Dialog(this.getApplicationContext());
dialog.setContentView(R.layout.create_dialog);
dialog.setTitle("Pwals");
break;
default:
dialog = null;
break;
}
return dialog;
}
}
The XMLs are just as simple as this code and they are running good
It crash when I it the menu button "create"
What I haven't understand :s ?
Thx for your answer
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---