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/topi ... stomDialog
my asnytask doInBackground method
Using java Syntax Highlighting
- @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;
- }
Parsed in 0.015 seconds, using GeSHi 1.0.8.4
my onCreateDialog from the activity
Using java Syntax Highlighting
- 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;
- }
Parsed in 0.012 seconds, using GeSHi 1.0.8.4
has anybody ever tried something similar?
thx for any help
grz