Hello,
I'm working on some application for android and I can't find anything
useful for my problem. I want to open / create new page (just like
first page / default page but with other functionalities) on button
click. I've tried to create custom dialog like on this page:
http://developer.android.com/guide/topics/ui/dialogs.html#AlertDialog
but when i clicked the button my application always crashed.
My code for custom dialog:
protected Dialog onCreateDialog(int id) {
Dialog dialog=null;
switch(id) {
case DIALOG_PAGE2_ID:
// do the work to define the PAGE2
break;
case DIALOG_PAGE_DEFAULT_ID:
// do the work to define the PAGE DEFAULT
Context mContext = getApplicationContext();
dialog = new Dialog(mContext);
dialog.setContentView(R.layout.page1);
dialog.setTitle("Custom Dialog");
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("Default page");
break;
default:
dialog = null;
}
return dialog;
}
Here i want to open / call it:
this.LogIN = (Button)this.findViewById(R.id.LogIN);
this.LogIN.setOnClickListener(new OnClickListener1() {
public void onClick(View v) {
showDialog(DIALOG_PAGE_DEFAULT_ID);
}
});
Is Custom dialog solution to my problem or should I create new
layout?
P.S.
Sorry for mistakes in my English
Regards,
Tadej
--
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en