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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:32:19+00:00 2026-05-23T12:32:19+00:00

Okay so i have a class called viewList. When the item it long pressed

  • 0

Okay so i have a class called viewList. When the item it long pressed the id is looked up of that item in my SQL database. And starts a new activity. How would i transfer this id that is retrieved on long press, to my new activity so it can intern look up the info.

case R.id.lookup_book:
    AdapterContextMenuInfo web = 
        (AdapterContextMenuInfo)item.getMenuInfo();

            mDbHelper.fetchinfo(web.id);
    Intent v = new Intent(this, bookLookup.class);
    startActivity(v);

I would like to pass the web.id to this activity

public class bookLookup extends Activity {
WebView webView;
private DbAdapter mDbHelper;
@Override
public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);

    setContentView(R.layout.book_browser);
    webView = (WebView)findViewById(R.id.webkit);



}

}

  • 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-23T12:32:20+00:00Added an answer on May 23, 2026 at 12:32 pm

    In your longClickListener add a metgod to put extra data into the intent. It can be done in this way

    Intent intent = new Intent(this, bookLookup.class);
    intent.putExtra("myId", id);
    startActivity(v);
    

    In the new activity you can retrieve this extra value by using this

    Bundle extras = getIntent().getExtras();
    int id = extras != null ? extras.getLong("myId") : -1;
    

    Take care that the myId string that I used to pass and retrieve values between activities should be the same. You can pass multiple items in this way by giving a unique name for each item and use the same name to retrieve them.

    You can pass any primitive datatypes in this way. I used long as an example.

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

Sidebar

Related Questions

Okay so I have defined my DSNavigationManager class and it has a property called
Okay, my site is www.kristianbak.com . I have a css class called activebutton .
Say I have a tableview class that lists 100 Foo objects. It has: @property
I have a base-class called Element. Some other classes (like Label and Image) both
Let's say I have an abstract class called ViewController, and another abstract class called
Okay, the post title might be a little confusing. I have this code: class
Hello I have a Class Called EmpowerCalendarCode: It has the following fields CalendarCode, CalendarName,
I have a Java class which can be called from shell. (via java [command][options])
Okay I have this RewriteRule which is supposed to redirect any request for the
Okay so I have the following Code which appends a string to another in

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.