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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:12:10+00:00 2026-05-25T10:12:10+00:00

I have a ListView with a context menu where the user can take a

  • 0

I have a ListView with a context menu where the user can take a picture. I take the picture like this:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
this.startActivityForResult(intent, PICTURE_RESULT);

and retrieving it like this:

public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == PICTURE_RESULT) {
        long itemId = ???
        savePicture(itemId, data.getExtras());
    }
}

How do I pass along the ListView item id? I tried intent.putExtras and intent.getLongExtra, but the data is not passed with the result intent. I can’t use an instance variable because the activity can get destroyed if the user swaps to landscape when taking the picture.

  • 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-05-25T10:12:11+00:00Added an answer on May 25, 2026 at 10:12 am

    Store that variable as an Activity class member and then you can use it from every place of that Activity class.
    If you want to save variable state then you should use onSaveInstance state callback. Refer to the developer docs.

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

Sidebar

Related Questions

I have a ListView, which can either have a context menu, or not. I
I have a listview with two columns and I'm using a context menu to
so I have attached a context menu (right-click menu) to a wpf listview. unfortunately,
I am extending BaseAdapter to make a custom listview row. I have context menu
I have a ListView whereby I want to display one context menu if an
I have 1 activity, but would like to have multiple context menu's for different
I have a list view filled with data. I set up a context menu
I have a listview with custom array adapter, the view allows the user to
My situation is like following. I have a App.xaml which includes Style for ListView
I have a listview, where I set the datasource in the code-behind - this

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.