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

The Archive Base Latest Questions

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

I have a database of webpages like this: import android.provider.BaseColumns; public interface ThreadDatabase extends

  • 0

I have a database of webpages like this:

import android.provider.BaseColumns;
    public interface ThreadDatabase extends BaseColumns {
    String TABLE_NAME = "Threads";
    String TITLE = "Title";
    String DESCRIPTION = "Description";
    String URL = "Url";
    String[] COLUMNS = new String[] { _ID, TITLE, DESCRIPTION, URL };
}

And a Listview in my Activity with a SimpleCursorAdapter that displays Title and Descripton in every row.

Cursor c = dbhelper.getDatabase();
setListAdapter(new SimpleCursorAdapter(this,
            android.R.layout.simple_list_item_2, c, new String[] {
                    ThreadDatabase.TITLE, ThreadDatabase.DESCRIPTION },
            new int[] { android.R.id.text1, android.R.id.text2, })

How could I redefine onListItemClick method so that when I click on the item the right url is opened?

protected void onListItemClick(ListView l, View v, int position, long id) {
    ???Missing part???
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
    startActivity(intent);
}
  • 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-06T23:44:42+00:00Added an answer on June 6, 2026 at 11:44 pm

    I’m assuming your activity extends ListActivity. If so, in onListItemClick(), all you need to do is:

    protected void onListItemClick(ListView l, View v, int position, long id) {
    
        Cursor item = (Cursor)getListAdapter().getItem(position);
    
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
        startActivity(intent);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have database table like this +-------+--------------+----------+ | id | ip | date |
I have Database with date field. I see the time like: 1900-01-01 13:38:00.000 How
that my problem: I have database table like that: id (AI) market_id 1 6
Lets say I have a database table called Scrape possibly setup like: UserID (int)
I have a small mySQL database and a few simple php based webpages that
How do they do this? I would like to have web pages with data
I have a Postgresql database on the server side. I'd like to load data
Background: I have a User entity. The User entity looks like: private String name;
i have a database fill with information of the users who use my webpage.
I have database with multiple tables in Microsoft SQL Server with schema in tables

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.