I need a modal dialog (something like the calculator). But I've got some heavy problems.
1) I can open a dialog with my own xml:
Using java Syntax Highlighting
- Dialog d = new Dialog(this);
- d.setContentView( R.layout.numpad );
- d.setTitle( "Betrag wählen" );
- d.show();
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
well, it looks nice, just like a modal dialog. but I need to put the button listeners inside the calling activity, and thats ugly !
2) I can use AlertDialog.Builder without xml
Using java Syntax Highlighting
- Builder b = new AlertDialog.Builder(this);
- b.setTitle("Betrag wählen");
- b.setPositiveButton("OK", null);
- b.show();
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
3) I can use a SubActivity, this way my code stays within the activity, but it doesn't look like a modal dialog rather than a normal activity:
Using java Syntax Highlighting
- Intent intent = new Intent();
- intent.setClass(this, NumpadActivity.class);
- startActivityForResult(intent, 1234);
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
so is there another way for me? maybe I could extend Dialog? or any other suggestions?
greetings,
darolla

