hi

I try to open a custom dialog from a asnyctask. I dont get an
exception, but the dialog just don't shows...
When i try it from the activity (per example from the onClick-method)
the dialog shows without a problem. But when i first try it from the
asynctask and then from the onClick-method it doesn't work anymore...

I followed this tutorial : 
http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog

my asnytask doInBackground method
@Override
protected Object doInBackground(Object... params) {
  Looper.prepare(); // without this i got an exception, but i dont
have a idea what's this for...

  try {
    showDialog(0);
  } catch (Exception ex) {
    Log.e(Workout.class.getName(), ex.getMessage(), ex);
  }
  return null;
}


my onCreateDialog from the activity
    protected Dialog onCreateDialog(int id) {
        Dialog dialog = new Dialog(this);

        dialog.setContentView(R.layout.custom_dialog);
        dialog.setTitle("Custom Dialog");

        TextView text = (TextView) dialog.findViewById(R.id.text);
        text.setText("Hello, this is a custom dialog!");
        return dialog;
    }


has anybody ever tried something similar?

thx for any help

grz

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

Reply via email to