How to show pop up window in android?
I am developing a sample app.I am able to show alert on button click
having some tittle and button .But now I want to show a pop up window
having username (Label) and text field (Edit field) and a button. on click
on button.can I make another popup xml file for that ?
public void selfDestruct(View view) {
// Kabloey
Log.d("Naveen", "Test====");
System.out.println("----------------------ghfgjhf-----------------");
AlertDialog alertDialog = new
AlertDialog.Builder(SecondActivity.this).create();
alertDialog.setTitle("Reset...");
alertDialog.setMessage("R u sure?");
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//here you can add functions
} });
alertDialog.show();
}
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/self_destruct"
android:onClick="selfDestruct" />
No comments:
Post a Comment