Tag Archives: alert

6,758 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
4,973 views

Alert messagebox toast Android example code

Toast in Android application is equivalent of Alert in JavaScript or MessageBox in WinApi. // Toast android.widget.Toast.makeText(Context context, CharSequence text, int duration) // public static Toast makeText (Context context, CharSequence text, int duration)   Toast.makeText(getApplicationContext(), "Hello world!", Toast.LENGTH_SHORT).show();

Posted in Android Examples Code | Tagged , , , | Comments Off on Alert messagebox toast Android example code