We using intent for popup window.
- intent=new Intent(getApplicationContext(),yourtext.class);
- startActivityForResult(intent,text);
And need a onActivityResult method and manifest setting!!
But we making simple popup using AlterDialog!!
- AlertDialog.Builder alert = new AlertDialog.Builder(this);
- alert.setTitle("Input your name");
- alert.setMessage("Plz, input yourname");
- final EditText name = new EditText(this);
- alert.setView(name);
- alert.setPositiveButton("ok", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- }
- });
- alert.setNegativeButton("no",new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int whichButton) {
- }
- });
- alert.show();
See line 7~8!! adding EditText from normally alterdialog.
If we click to 'ok'button, we using edittext's text.
<Run>
This is simply popup input window!!
No comments:
Post a Comment