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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:43:58+00:00 2026-05-26T04:43:58+00:00

i am implementing a splitview using the new fragment from Google (Android 3). when

  • 0

i am implementing a splitview using the new fragment from Google (Android 3).

when user choose something from the list it is show value in the details area and keep list item highlight.

when i used array adapter it is keep list item focused after adding the following:

getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
getListView().setItemChecked(postition, true);

but when i change to use database using SimpleCursorAdapter and custom row xml file it is highlight just when i press.

“i want to keep highlight item in list view”

  • 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-26T04:43:59+00:00Added an answer on May 26, 2026 at 4:43 am

    You need to set the activated style for your list row. The catch is that this is only available on API Level 11 and higher.

    One way to do this is to use two separate styles. In res/values-v11/styles.xml, you could have:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
      <style name="activated" parent="android:Theme.Holo">
        <item name="android:background">?android:attr/activatedBackgroundIndicator</item>
      </style>
    </resources>
    

    Whereas res/values/styles.xml you would have:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
      <style name="activated">
      </style>
    </resources>
    

    Your row layout would then use that activated style, such as:

    <?xml version="1.0" encoding="utf-8"?>
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@android:id/text1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceLarge"
      android:gravity="center_vertical"
      android:layout_marginLeft="4dip"
      android:minHeight="?android:attr/listPreferredItemHeight"
      style="@style/activated"
    />
    

    Combined with your existing CHOICE_MODE_SINGLE logic, this will leave your row activated after it is tapped.

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

Sidebar

Related Questions

implementing publishActivity in PHP using the REST API using this code: $activity = array(
When implementing Quicksort, one of the things you have to do is to choose
While implementing a design using nested generic collections, I stumbled across those limitations apparently
I am iphone developer but now i am implementing cocoa application.I am new for
implementing service something similar with tinyurl or bit.ly, I'm would like to expose service
Implementing Document-View pattern I faced the problem: standard generic collections and dictionaries ( List<T>
When implementing a MessageFactory class to instatiate Message objects I used something like: class
while implementing hhtps, is there a way not to show the message Do you
Implementing a Thread by providing a new class that extends Thread and overriding its
when implementing/using methods that return or work with instances of objects, what is the

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.