Ok, I have 1 custom toast (xml layout) and it works great:
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.custom_toast, (ViewGroup) findViewById(R.id.toast_layout));
ImageView image = (ImageView) layout.findViewById(R.id.logo);
image.setImageResource(R.drawable.logo);
title = (TextView) layout.findViewById(R.id.title);
txt = (TextView) layout.findViewById(R.id.text);
toast = new Toast(appContext);
toast.setGravity(Gravity.FILL_HORIZONTAL|Gravity.BOTTOM, 0, 0);
toast.setDuration(Toast.LENGTH_LONG);
toast.setView(layout);
But when I try to make 2nd one same way I get error "Source not found" which doesn't really tell me anything about what's wrong.
LayoutInflater infl = getLayoutInflater();
View lay = infl.inflate(R.layout.toast_arrows, (ViewGroup) findViewById(R.id.toast_lay));
toastarrows = new Toast(appContext);
toastarrows.setGravity(Gravity.FILL_HORIZONTAL|Gravity.CENTER, 0, 0);
toastarrows.setDuration(Toast.LENGTH_SHORT);
toastarrows.setView(lay);
toastarrows.show();
I'd like those 2 toasts to appear almost same time in different places of the screen. Anyone can tell me please what's wrong with this code?