Я разрабатываю образец приложения. Я могу показать предупреждение при нажатии кнопки с помощью кнопки и кнопки. Но теперь я хочу показать всплывающее окно с именем пользователя (ярлыком) и текстовым полем (поле редактирования) и кнопку. нажмите кнопку button.can я могу сделать для этого еще один всплывающий xml файл?
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" />