I have a Custom Toast
which i want it to be display for 10 seconds
this is my code:
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.custom_toast,
(ViewGroup) findViewById(R.id.toast_layout_root));
TextView text = (TextView) layout.findViewById(R.id.text);
text.setText("please wait.... ");
text.setTypeface(type);
Toast toast = new Toast(getApplicationContext());
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.setDuration(10000);
toast.setView(layout);
toast.show();
but it doesn't work by setting toast.setDuration(10000);
is anyone know what is wrong in my code or how can i do this in another way?