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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:53:10+00:00 2026-06-17T03:53:10+00:00

Ok guys, so as an Android newbie Im working my way through various things.

  • 0

Ok guys, so as an Android newbie Im working my way through various things. My issue here is Im trying to start a new intent activity in a ‘onListItemClick’. I have the method set up for this but when i run the AVD upon clicking the item in the list, nothing happens, the intent doesn’t start.

If I change the the super class to ‘ListActivity’ I get a crash message of ‘your content must have a listview whose id attribute is ‘android.r.id.list”

Can anyone tell me why the intent wont start from clicking the item in the listview?
Here’s my listview class:

package com.example.sqliteexample;



import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.widget.SimpleCursorAdapter;
import android.view.View;
import android.widget.ListView;
import android.widget.Toast;

public class SQLView extends ListActivity {

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    HotOrNot H = new HotOrNot(this, null, null);

    setContentView(R.layout.layout);
    ListView listContent = (ListView)findViewById(R.id.contentList);

    HotOrNot Content = new HotOrNot(this, null, null);
    Content.open();
    Cursor cursor = Content.getData();

    startManagingCursor(cursor);

    @SuppressWarnings("static-access")
    String [] from = new String [] {H.KEY_NAME, H.KEY_HOTNESS};
    int [] to = new int [] {R.id.txtName, R.id.txtAge};

    @SuppressWarnings("deprecation")
    SimpleCursorAdapter cursorAdapter = new SimpleCursorAdapter(this, R.layout.entries, cursor, from, to);

    listContent.setAdapter(cursorAdapter);
 }


public void onListItemClick(ListView l, View v, int posistion, long id)
{

    Intent i = new Intent("com.example.sqliteexample.SQLiteExample");

    startActivity(i);
}




}
  • 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-17T03:53:11+00:00Added an answer on June 17, 2026 at 3:53 am

    if you’re gonna use a ListActivity then you don’t need this line:

    ListView listContent = (ListView)findViewById(R.id.contentList);
    

    BUT that specific ListView being referred to right now (provided it’s in the corresponding xml layout) must have it’s id changed to

    <ListView
      android:id="@android:id/list"
    .....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys simple question here. Whats the best way to back up an android
hey guys i am working on android application , i am trying to creat
Hello guys I'm trying to send a cookie with http post in android here's
Hey guys I am working on android application. My app includes an activity which
Hi guys I am new to android...I want to display a dynamic list of
Hi guys I am trying to set up a Login form in my android
Possible Duplicate: Android : Location.distanceTo not working correctly? I am trying to calculate the
guys i am working on android 2.2 i am stuck where the user need
guys i am working on android 2.2.I have a situation where when the user
Hi guys there is an activity on my current android app that has a

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.