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 7824815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:43:27+00:00 2026-06-02T08:43:27+00:00

int i = 1; String IMG = pic; IMG = IMG + Integer.toString(i); i

  • 0
int i = 1;
String IMG = "pic";
IMG = IMG + Integer.toString(i);
i = i + 1;   

imageview1.setImageResource(R.drawable.IMG);

R.drawable.IMG where IMG is a variable.

This is wrong. What would the right way? I want to change a imageview from pic1 to picN.


int[] images = new int[]{R.drawable.pic1, R.drawable.pic2, R.drawable.pic3};

This is better, but How can I insert a vector element into a imageview?
Sorry for my bad english level 🙂

  • 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-02T08:43:29+00:00Added an answer on June 2, 2026 at 8:43 am

    The identifiers that identify the resources in your app are not a series of sequential numbers. Create an array of the images you’ve added, e.g.

    int[] images = new int[]{R.drawable.pic1, R.drawable.pic2, R.drawable.pic3};
    

    and increment the index in that instead?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tables like this: tblUsers int UserID string UserName tblUsersInRoles int UserID int
I saw this post Linq int to string , and tried it var personalInfoQuery
I need to display in image on the view this way <img src =
for(int i=0;i<StoreparsrData.title.size();i++){ HashMap<String,String> temp = new HashMap<String,String>(); Bitmap bt=Utility.getBitmapFile(StoreparsrData.url.get(i).toString()); ImageView img=(ImageView)findviewbyid(R.id.img); img.setImageBitmap(bt); but iwant
<% for (int i = 0; i < 8; i++) { if(!string.IsNullOrEmpty(PictureName10)){ %> <img
public function bmdToStr(bmd:BitmapData,width:int,height:int):String { var encoder:JPEGEncoder = new JPEGEncoder(); var encBytes:ByteArray = encoder.encode(bmd); return
I am executing the following code: def takeN(s : String, n : Int): String
Is it possible to Deserialize the following piece of XML into a Dictionary<int,string> object?
Can i pass strings as arguments during method.Invoke(objectname,object[]params) for a method of signature Getdetails(int,string,bool)
let's consider a small method: int MyFunction(string foo, int bar) { ... } and

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.