You'd have to meddle with the native GUI which is... not what you want to do. It could potentially work, but you would lack advanced features, such as XML layout definition. You might be better off writing your own that would fit into your app's style. However, if you just want a popup window...
- //Import required classes
- import android.app.AlertDialog;
- import android.content.DialogInterface;
- ...
- //Create the AlertDialog
- AlertDialog alertDialog = new AlertDialog.Builder(this).create();
- //Set the title
- alertDialog.setTitle("Alert");
- //Set the message
- alertDialog.setMessage("This is an AlertDialog!");
- //Add the OK button
- alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- //The OK button has been clicked
- }});
- //Display the AlertDialog
- alertDialog.show();
I think this will work, but it may not... also, it is import to note that calling
alertDialog.show() will halt your application until the dialog is closed. And if you want to add user input, that's a great deal more complicated.