I am newbie to android don’t know much about it. I have imported a image to my project and when i tried it check it using File that the file exists or not.
This is the code i have used..
existingFileName="res/drawable-ldpi/login.png";
File f= new File(existingFileName);
// Log.d("Image path",);
if(f.exists())
{
Log.d("EXISTS", "====File Exists===");
}
Still it is showing me no image exist.
thanks for help in advance,
aby
If you store the image in the “res/drawable” folder you can do:
See http://developer.android.com/reference/android/content/res/Resources.html#getDrawable
For the case you store your image in the assets folder, you need to use
getAssets()( http://developer.android.com/reference/android/content/Context.html#getAssets() )You can do something like this:
Remember that for both case you need to have a
Context(ie anActivity)