[Solved] Alert dialog with button throws exception

Use it accordingly AlertDialog.Builder alertbox = new AlertDialog.Builder(YourActivity.this); alertbox.setTitle(“Do you want To exit ?”); alertbox.setPositiveButton(“Yes”, new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { // finish used for destroyed activity exit(); } }); alertbox.setNegativeButton(“No”, new DialogInterface.OnClickListener() { public void onClick(DialogInterface arg0, int arg1) { // Nothing will be happened when clicked on no button … Read more

[Solved] Custom popup dialog with input field [closed]

try to use this custom popup dialog code main.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical” > <Button android:id=”@+id/buttonPrompt” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Show Prompt Dialog” /> <EditText android:id=”@+id/editTextResult” android:layout_width=”match_parent” android:layout_height=”wrap_content” > </EditText> </LinearLayout> Custom.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/layout_root” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical” android:padding=”10dp” > <TextView android:id=”@+id/textView1″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Type Your Message : ” android:textAppearance=”?android:attr/textAppearanceLarge” … Read more