can not identified widget?
Ca开发者_如何学Cn anyone please let me know what widget is this? Please refer to the attachment for the widget in question.
It is launched from the messaging app, when I click on a received message.
It shows the text as the application name. I have searched for the term 'Messaging', but to no effect.
Thanks,
This is not a Toast
message; it is an AlertDialog
public class yourActivity extends Activity {
public final static int DIALOG_ERROR = 1;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
showDialog(DIALOG_ERROR); //this will call: onCreateDialog()
}
protected Dialog onCreateDialog(int id) {
Dialog dialog;
switch(id) {
case DIALOG_ERROR:
//create dialog
dialog = new AlertDialog.Builder(this).setMessage("Messaging").create();
break;
default:
//create a default dialog
dialog = null;
}
return dialog;
}
}
This is a Toast
message with a custom View
. This tutorial can help you create your own.
For more on customizing a Toast object, check out this other tutorial.
精彩评论