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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:55:10+00:00 2026-06-01T08:55:10+00:00

I created a customized CursorAdapter and want to select a list item, in order

  • 0

I created a customized CursorAdapter and want to select a list item, in order to start an action in onOptionsItemSelected.

Creating List View:

public void onCreate(Bundle savedInstanceState) {
    Log.d(TAG, "onCreate called");
    super.onCreate(savedInstanceState);

    Log.d(TAG, "create DatabaseOpenHelper");
    DatabaseOpenHandler helper = new DatabaseOpenHandler(this);

    Log.d(TAG, "get writeable database access");
    database = helper.getWritableDatabase();

    Log.d(TAG, "create Cursor for database access");
    Cursor data = database.query(DatabaseConstants.TABLE_NOTES, fields,
            null, null, null, null, null);

    Log.d(TAG, "set NoteCursorAdapeter");
    setListAdapter(new NoteCursorAdapter(this, data));  
}

onOptionItemSelected:

public boolean onOptionsItemSelected(MenuItem item) {
    Log.d(TAG, "onOptionItemSelected called");
    switch (item.getItemId()) {
    case R.id.conference_note_menu_new:
        Toast.makeText(this, "Es sind keine Einstellungen verfügbar",
                Toast.LENGTH_LONG).show();
        return true;

    case R.id.conference_note_menu_edit:
        Toast.makeText(this, "Es sind keine Einstellungen verfügbar",
                Toast.LENGTH_LONG).show();
        return true;

    case R.id.conference_note_menu_delete:
        Toast.makeText(this, "Es sind keine Einstellungen verfügbar",
                Toast.LENGTH_LONG).show();
        return true;

    default:
        return super.onOptionsItemSelected(item);
    }
}

Can’t find any useful information on the internet.

  • 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-01T08:55:12+00:00Added an answer on June 1, 2026 at 8:55 am

    onOptionItemSelected is for menu. you need set onItemClickListener for your ListView like this:

    getListView().setOnItemClickListener(this);
    

    and implements:

    @Override
    public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
        // TODO Auto-generated method stub
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a customized WordPress theme based on an existing site. I want to
We've created a highly customized Joomla 1.5 based site and want our super administrator
I have created a customized System Service, and i want my service to capture
I have created my own customized lots of architecture including n-tier layers for different
I want to create a customized UIView class (a static lib) for some app
I have created a customized BasicEditField with Border using Bitmap.Now while typing the text,it
I created a Search Center site and customized it with a new masterpage. I
I created an XLAM file which displays a customized ribbon tab, the buttons of
I created a PHP script to read the error log file in a customized
In project gproc's file gen_leader.erl,a customized behavior is created. But In the following statement,

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.