android drawable from file path -


i have file path string of form "e:\...\xxx.jpg" how create drawable it?

you can create drawable or bitmap string path this:

 string pathname = "/path/to/file/xxx.jpg";   drawable d = drawable.createfrompath(pathname); 

for bitmap:

string pathname = "/path/to/file/xxx.jpg"; bitmap b = bitmapfactory.decodefile(pathname); 

Comments