Hi,

I have a an AlertDialog where I inflate a View.
In that View is also a Button. But when I add the command
setOnClicklistener
my Code crash? Can you tell me why.. I guess there was a moment it
worked.. but I never got it back

Can't I include an OnClicklistener to a Button in View I like to
implement into a AlertDialog??
And if.. how?

Thank Chris


@Override
protected Dialog onCreateDialog(final int id) {
 switch (id) {
  case DIALOG_NOTE :
    LayoutInflater factory3 = LayoutInflater.from(this);
    final View apiEntryView3 = factory3.inflate(R.layout.setbasal2,
null);
    TextView dapikeyfield3 = (TextView) apiEntryView3.findViewById
(R.id.basaltemp);

    Button buttontemp = (Button) findViewById(R.id.bbacktemp);

//--- the problem
    buttontemp.setOnClickListener(new OnClickListener() {
        public void onClick(View v)
        {
          //empty till now
        }  });
//--------------------------

     return new AlertDialog.Builder(datepicker.this).setIcon
(R.drawable.alert_dialog_icon).setTitle("123").setView(apiEntryView3)
        .setPositiveButton("OK", new DialogInterface.OnClickListener()
{public void onClick(DialogInterface dialog, int whichButton) {
    .....


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to