Re: [android-beginners] AlertDialog problem: always get NULL values
The LogCat info will tell you more about the crash, like exactly what is causing it. -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Sat, Jan 16, 2010 at 6:47 AM, Dominik derbsl...@gmail.com wrote: hello I have an Activity class in which I have this method which returns an AlertDialog: protected Dialog onCreateDialog(int id) { switch (id) { case 0: (returns an alert...) case 1: LayoutInflater factory = LayoutInflater.from(this); final View textEntryView = factory.inflate (R.layout.register_member, null); return new AlertDialog.Builder(CheatView.this).setIcon (R.drawable.alert_dialog_icon) .setTitle(R.string.register_title) .setView(textEntryView).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { EditText editUsername = (EditText) findViewById(R.id.username_edit); EditText editPassword = (EditText) findViewById (R.id.password_edit); EditText editMail = (EditText) findViewById(R.id.email_edit); } }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { /* User clicked cancel so do some stuff */ } }).create(); } return null; } when the user presses OK I want to grab the information he entered in that AlertDialog EditText field (i.e. editUsername ) - my problem is that I always get NULL values. after pressing the OK button the application crashes. Does anyone have an idea what I am doing wrong? thanks for help! -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] AlertDialog problem: always get NULL values
hello I have an Activity class in which I have this method which returns an AlertDialog: protected Dialog onCreateDialog(int id) { switch (id) { case 0: (returns an alert...) case 1: LayoutInflater factory = LayoutInflater.from(this); final View textEntryView = factory.inflate (R.layout.register_member, null); return new AlertDialog.Builder(CheatView.this).setIcon (R.drawable.alert_dialog_icon) .setTitle(R.string.register_title) .setView(textEntryView).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { EditText editUsername = (EditText) findViewById(R.id.username_edit); EditText editPassword = (EditText) findViewById (R.id.password_edit); EditText editMail = (EditText) findViewById(R.id.email_edit); } }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { /* User clicked cancel so do some stuff */ } }).create(); } return null; } when the user presses OK I want to grab the information he entered in that AlertDialog EditText field (i.e. editUsername ) - my problem is that I always get NULL values. after pressing the OK button the application crashes. Does anyone have an idea what I am doing wrong? thanks for help! -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] AlertDialog problem: always get NULL values.
hello I have an Activity class in which I have this method which returns an AlertDialog: protected Dialog onCreateDialog(int id) { switch (id) { case 0: (returns an alert...) case 1: LayoutInflater factory = LayoutInflater.from(this); final View textEntryView = factory.inflate (R.layout.register_member, null); return new AlertDialog.Builder(CheatView.this).setIcon (R.drawable.alert_dialog_icon) .setTitle(R.string.register_title) .setView(textEntryView).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { EditText editUsername = (EditText) findViewById(R.id.username_edit); EditText editPassword = (EditText) findViewById (R.id.password_edit); EditText editMail = (EditText) findViewById(R.id.email_edit); } }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { /* User clicked cancel so do some stuff */ } }).create(); } return null; } when the user presses OK I want to grab the information he entered in that AlertDialog EditText field (i.e. editUsername ) - my problem is that I always get NULL values. after pressing the OK button the application crashes. Does anyone have an idea what I am doing wrong? thanks for help! -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en