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" />
Try to use: PopupWindow
You can find example here: http://android-er.blogspot.co.il/2012/03/example-of-using-popupwindow.html
Use the below coding to display a Pop up in android.
Youtube link: https://www.youtube.com/watch?v=SEsVTTl6exg
Try this...
you can use Dialog , like this code :
if you want to remove title bar just use this code after define :
custom_dialog.xml
Need to inflate custom_dialog.xml
its working for me