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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:00:58+00:00 2026-06-14T20:00:58+00:00

I am sending a selected image from image gallery to NextImage.java activity using intent.

  • 0

I am sending a selected image from image gallery to NextImage.java activity using intent. I want to send the selected position of the image and the arrays of image to next activity. am getting confused with intent.

String[]imageUrls= new String[PostDetails.size()];

for (int index=0;index<imageUrls.length;index++){

       imageUrls[index]=PostDetails.get(index).getImag();
}



gallery = (Gallery) findViewById(R.id.img_gallery);

gallery.setAdapter(new ImagePagerAdapter(imageUrls));


gallery.setOnItemClickListener(new OnItemClickListener() {

      public void onItemClick(AdapterView<?> gallery, View view, int position, long id) {



          Intent galleryIntent  = new Intent(ImageGalleryActivity.this, MyNextImage.class);

          galleryIntent.putExtra(imageUrls, position);

          startActivity(galleryIntent);

      }

in the next image class:

private ViewPager pager;

String[] imageUrls;

private DisplayImageOptions options;

String images;

public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.view_flipper_item);

    Bundle bundle = getIntent().getExtras();

    String[] imageUrls = bundle.getStringArray(images);

    int pagerPosition = bundle.getInt(position, 0);
  • 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-14T20:00:59+00:00Added an answer on June 14, 2026 at 8:00 pm

    you put extras as follows:

    galleryIntent.putExtra("IMAGE_URLS", imageUrls);
    galleryIntent.putExtra("POSITION", position);
    

    and get extras back as follows:

    String[] imageUrls = bundle.getStringArray("IMAGE_URLS");
    int pagerPosition = bundle.getInt("POSITION", 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to pass selected value on invoice.php file using jQuery. After sending value
Sending XML from C# Server and receiving it it in Android Java client This
sending mail along with embedded image using asp.net I have already used following but
I wrote an sms sending application using the instructions Here . Now I want
I am sending emails from my website using codeigniters email helper (SMTP) Emails are
sending text to label and number to int from tabelview to viewcontroller but it
Sending Email in Android using JavaMail API without using the default/built-in app I'm trying
I sending ajax request from a jQuery file like below, which expects response in
When sending data from one iOS device to another, I receive these errors. 2012-06-21
I want to populate a TableView with data from a database and, when tap

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.