tags:

views:

45

answers:

2

I want to retrieve an image from my data/data/com.apps.myapp/images folder and display it in an ImageView. Any clue?

+1  A: 

There are several components involved in this. To get the path of your data folder you can use the method getDir in the Context. Now you have to know the file name and open an stream here again the Context class is your friend. Now the stream can be decoded into a Bitmap via a Bitmap Factory. After you got a Bitmap create a BitmapDrawable from it and pass it to your ImageView

Janusz
+1  A: 

Try this :

Bitmap bitmap = BitmapFactory.decodeFile("data/data/com.apps.myapp/images/img.png");
ImageView imgView = (ImageView) this.findViewById(R.id.imgViewId);

imgView.setImageBitmap(bitmap);