Tag Archives: dialog

5,119 views

AlertDialog setButton Deprecated

Solution: public void alertMy(String sTitle, String sMessage){ AlertDialog.Builder builder = new AlertDialog.Builder(Test.this); // activity builder.setTitle(sTitle) .setMessage(sMessage) .setCancelable(false) .setNegativeButton("Close",new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = builder.create(); alert.show();   }

Posted in Bugs, warnings, errors | Tagged , , | Comments Off on AlertDialog setButton Deprecated
11,782 views

Create About Dialog Android Example

Wiktionary – SDK samples Android protected void showAbout() { // Inflate the about message contents View messageView = getLayoutInflater().inflate(R.layout.about, null, false);   // When linking text, force to always use default color. This works // around a pressed color state … Continue reading

Posted in Android Examples Code | Tagged , | Comments Off on Create About Dialog Android Example
3,140 views

Dialog With RadioButton Android Example

private void dialogModeFC() { try { final AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this) .setTitle(R.string.select_dialog) //.setItems( .setSingleChoiceItems(R.array.select_dialog_items, -1 , new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) {   /* User clicked so do some stuff <item>Happy New Year</item> <item>Merry Christmas</item> … Continue reading

Posted in Android Examples Code | Tagged , | Comments Off on Dialog With RadioButton Android Example
6,220 views

AlertDialog yes no – Alert – Messagebox – Android sample

Dialog Yes No sample code AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage("Are you sure you want to exit application?") .setCancelable(false) .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { MyActivity.this.finish(); //Close this Activity for example: MyActivity.java } }) .setNegativeButton("No", … Continue reading

Posted in Android Examples Code | Tagged , | Comments Off on AlertDialog yes no – Alert – Messagebox – Android sample
8,650 views

AlertDialog – MessageBox – Alert – Toast – Android sample

AlertDialog like MessageBox by WinApi: If error: Unable to add window — token null is not for an application try change get Context. // you can put this text into some function body or case in switch statement new AlertDialog.Builder(this) … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on AlertDialog – MessageBox – Alert – Toast – Android sample
3,341 views

LayoutLib is too recent. Update your tool Eclipse Android

LayoutLib is too recent. Update your tool! Eclipse Android Graphical layout resolving problem. Open in Eclipse menu Help ->Check for Updates Select updates: Press Next and update all Restart Eclipse

Posted in Android Examples Code, Eclipse | Tagged , , , , | Comments Off on LayoutLib is too recent. Update your tool Eclipse Android