Tag Archives: Toast

Dynamically Load images in ANDROID? OR Load image in ANDROID using a string path.

By | May 10, 2013

With the following code you can load images in your drawable folder dynamically by giving the filename as a String. For that you have to use getResources().getIdentifier which has parameters as the “path”,”drawable” and the “package name”. This returns a unique resource ID which can be used to set the image for a ImageView using… Read More »

Detect when the ANDROID Screen Goes Off ?

By | January 18, 2011

This is the main Java file that extends activity. Create a file named ScreenON_OFF_ACTIVITY.java and place the below code in it. This is the class that extends the Broadcast receiver class that receives the notifications. create a java file and name it ScreenReceiver.java and place the following code in it. This the class that updates… Read More »

Custom Toasts in ANDROID.

By | June 4, 2012

First, just show an image inside a toast: This method just displays a text toast: And this method displays a Toast that contains both an image and text: