Is it possible to put an image into a Toast?
If not, does anyone know of any way to dismiss a Dialog after a couple of seconds? (Basically tell a dialog to act like a Toast).


MrSnowflake wrote:Very simple Toast Image example:Using java Syntax Highlighting
Toast toast = new Toast(this); ImageView view = new ImageView(this); view.setImageResource(R.drawable.icon); toast.setView(view); toast.show(); Parsed in 0.034 seconds, using GeSHi 1.0.8.4
[edit]Another one:Using java Syntax Highlighting
Toast toast = Toast.makeText(this, "lalalal", Toast.LENGTH_LONG); View textView = toast.getView(); LinearLayout lay = new LinearLayout(this); lay.setOrientation(LinearLayout.HORIZONTAL); ImageView view = new ImageView(this); view.setImageResource(R.drawable.icon); lay.addView(view); lay.addView(textView); toast.setView(lay); toast.show(); Parsed in 0.036 seconds, using GeSHi 1.0.8.4
The image is not on the background the text is on, but if you want to achieve that, you need to extend Toast.

AndDev: Your Android Development Community / Tutorials | Here's my Basic ToolKit

Return to View, Layout & Resource Problems
Users browsing this forum: No registered users and 6 guests