-6

i would like to Display an image gallery but from "assets/images" folder not from the phone storage.

like this one: enter image description here

  • 1
    Stack Overflow is for programming questions. What is your question? If your question is "how do I do this?", please explain what you have tried and what specific problems you have encountered. – CommonsWare Jun 05 '17 at 18:32
  • im asking to how to do it? ^_^ cause im new in android so im asking if someone can give me a way to do it – Sabri Boughanmi Jun 05 '17 at 18:49
  • 3
    That's too broad. You should consider looking up some tutorials that will build you up to this point. – Lexi Jun 05 '17 at 18:52

1 Answers1

0

The question is not clear, if you want to load a single image from assets, then you can do it this way.

//read image from asset
InputStream is = getAssets().open("image.jpg");

//    create a drawable
Drawable drawable = Drawable.createFromStream(is, null);

//find reference to your imageview and set drawable
ImageView i=(ImageView)findViewById(R.id.image_id); 
i.setImageDrawable(drawable);
Adithya
  • 1,688
  • 1
  • 10
  • 18