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

  • SEARCH
  • Home
  • 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 8113125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:43:40+00:00 2026-06-06T02:43:40+00:00

I have taken following array; to fill-up gallery: private Integer[] mImageIds = { R.drawable.one,

  • 0

I have taken following array; to fill-up gallery:

private Integer[] mImageIds = { R.drawable.one, R.drawable.two,
            R.drawable.three, R.drawable.four, R.drawable.five,
            R.drawable.six, R.drawable.seven, R.drawable.eight,
            R.drawable.nine, R.drawable.ten, R.drawable.elevan,
            R.drawable.twelve, R.drawable.thirteen, R.drawable.fouteen,
            R.drawable.fifteen, R.drawable.sixteen
    };

and then I am using click event of gallery:

coverFlow.setOnItemClickListener(new OnItemClickListener() {

         @Override
         public void onItemClick(AdapterView arg0, View v, int position,
         long rowID) {
             String s = mImageIds[position].toString();
             Toast.makeText(v.getContext(), s , 1000).show();
         }
         });

but here Toast gives me integer number 2130837507;

If I take only mImageIds[position] in Toast

then it displays path res/drawable-mdpi/image_name.jpg, but actually it is not string.
And I want to retrieve String (image_name) from it.
Can any one help me?

  • 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-06T02:43:42+00:00Added an answer on June 6, 2026 at 2:43 am

    Don’t do a toString on the number you get back. If you want a string from the resource Id as the title of your question suggests, do this:

    getResources().getString(mImageIds[position]);
    

    However, it seems like you want the image name, though that’s not what the title of your question is. If that’s the case, this should work:

    getResources().getResourceEntryName(mImageIds[position]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have following problem with validate checkbox array. The validation is bypassed, have taken the
I have the following array: private int[,] testSamples = new testSamples[101,101]; It's supposed to
I have taken following code from my template file, <a onclick=previewPop('<?= $this->url(array('controller'=>'report', 'action'=>'generatepreview','report_date'=>str_replace(%2F, /,
I have taken the following object as an example: var questions = { 1:
I have the following piece of code taken from the PHP manual on the
i have the following code, taken partly from a Red Black Tree Java implementation.
Hi I have the following bubble sort algorithm (generic code taken from another site)
I have a collection of the following sort of documents (taken from Mongo DB
I have the following code (taken from actual script): $result=mysql_query($sql); while($row=mysql_fetch_assoc($result)) { $auth_token=$row['oauth_token']; $auth_token_secret=$row['oauth_token_secret'];
please consider the following: I have a queue of objects represented as an array.

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.