Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8625149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:42:39+00:00 2026-06-12T07:42:39+00:00

i am using image slider in my layout, for this i used private Integer[]

  • 0

i am using image slider in my layout, for this i used

      private Integer[] mImageIds = { R.drawable.j, R.drawable.f,R.drawable.i,    R.drawable.g, R.drawable.k }; 

to take the images.But now i want to take the images from sdcard and store these images into that array.How can i do this?
below is my code. i stored thumb in database.I converted bitmap to drawable and then how to store this into Array mImages?

      List<String> thumb = new ArrayList<String>();
     public Integer[] mImageIds;
     Bitmap bitmap;
            thumb = db.getRecomdThumb();//get image address from db
    for(int i = 0; i < thumb.size();i++){
        bitmap = BitmapFactory.decodeFile(thumb.get(i));
        Drawable d = new BitmapDrawable(getResources(),bitmap);

    } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:42:40+00:00Added an answer on June 12, 2026 at 7:42 am

    Only the images you store inside the “res” folder can be added to a Integer array. You can create a int res from dynamically created Bitmap. You can only convert it to Drawable as you have mentioned in your code.

    If you ask me, will it be possible to get Int representation if I add the dynamically created drawable to res folder, it is not possible.

    “Res” folder can’t be modified. It is read only.

    So what you have to do is, just create a Drawable array instead of Integer array and do your operation.

    Something like this would work,

      List<String> thumb = new ArrayList<String>();
         public Integer[] mImageIds;
         Bitmap bitmap;
                thumb = db.getRecomdThumb();//get image address from db
      private Drawable[] drawables = new Drawable[thumb.size()];
        for(int i = 0; i < thumb.size();i++){
            bitmap = BitmapFactory.decodeFile(thumb.get(i));
            drawables[i] = new BitmapDrawable(getResources(),bitmap);
    
        } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this cool image slider http://www.jscraft.net/demo/plugins/filters/ , but as you can see, using
I am using nivo jquery image slider in my asp.net application, but after page
I made an image slider using this plugin http://slidesjs.com/ while ago for a mobile
I'm using jQuery Blinds Slideshow as image slider. I want to redirect the first
i Had load my image Buffered image now need to brighten it using Slider
I'm using jQuery Tools Plugin as image slider ( image here ), but due
I can't understand the reason of this trouble: I'm using image slider and everything
I am trying to rotate an image using slider..its working well but when i
I am using image slider specified at: here My images are of different sizes
Here i am using a image slider and a cycle plugin of jquery. but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.