Is there anyway I can tell a Toast Notification to show up only for a specified amount of time. Generally shorter then a regular toast message.
//try it
public void myToast(String message) {
LayoutInflater myInflator = getLayoutInflater();
View myLayout = myInflator.inflate(R.layout.custom_layout,
(ViewGroup) findViewById(R.id.toastlayout));
TextView myMessage = (TextView) myLayout.findViewById(R.id.label);
myMessage.setText(message);
Toast toast = new Toast(getApplicationContext());
toast.setView(myLayout);
toast.setDuration(400);
myMessage.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL
| Gravity.CENTER_VERTICAL);
toast.show();
}