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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:51:16+00:00 2026-05-27T15:51:16+00:00

I am creating some views in my xml file, xml file contaings list-view. In

  • 0

I am creating some views in my xml file, xml file contaings list-view.
In that list-view I have list selector attribute and i defined drawable
image for selector.

My xml file follows like this:

<?xml version="1.0" encoding="utf-8"?>
        <FrameLayout android:id="@+id/frameLayout1" 
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent"
            xmlns:android="http://schemas.android.com/apk/res/android">
            <com.naaima.vovinet.activity.VideoNativePlayer 
                    android:layout_marginLeft="50dip" 
                    android:layout_width="800dip" 
                    android:layout_marginRight="30dip" 
                    android:id="@+id/video_view" 
                    android:layout_height="600dip" 
                    android:layout_marginTop="50dip">
                </com.naaima.vovinet.activity.VideoNativePlayer>
            <ImageView android:src="@drawable/icon" 
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content" 
                android:id="@+id/imageView1"/>
            <ImageView android:src="@drawable/icon" 
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content"
                android:layout_gravity="center_horizontal" 
                android:id="@+id/imageView2"/>  

            <LinearLayout android:id="@+id/linearlayout"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">

            <TextView 
                    android:id="@+id/textView_channelno" 
                    android:layout_width="130dip"
                    android:hint="_ _ _"
                    android:layout_marginLeft="1050dip" 
                    android:layout_marginTop="20dip"
                    android:background="@drawable/sample"
                    android:gravity="center"
                    android:textSize="25dip"
                    android:visibility="gone"
                    android:layout_height="80dip"/>


                </LinearLayout>



            <FrameLayout android:id="@+id/frameLayout2" 
                android:layout_width="1100dip" 
                android:layout_height="wrap_content"
                android:background="@drawable/bg1"
                android:layout_gravity="bottom"
                android:layout_marginLeft="100dip"
                android:layout_marginBottom="15dip">



                <RelativeLayout android:id="@+id/relativeLayout1" 
                    android:layout_width="fill_parent" 
                    android:layout_height="fill_parent">
                        <ProgressBar style="?android:attr/progressBarStyleHorizontal" 
                            android:layout_width="730dip" 
                            android:layout_height="wrap_content" 
                            android:id="@+id/progressBar" 
                            android:layout_marginTop="30dip"
                            android:background="@drawable/progress_bar_bg"
                            android:layout_marginLeft="180dip"/>

                        <TextView android:id="@+id/textView_date" 
                            android:layout_height="wrap_content" 
                            android:layout_width="wrap_content"
                            android:layout_toRightOf="@+id/progressBar"
                            android:layout_marginTop="30dip"
                            android:layout_marginLeft="50dip"/>

                        <TextView android:id="@+id/textView_time" 
                            android:layout_height="wrap_content" 
                            android:layout_width="wrap_content" 
                            android:layout_below="@+id/textView_date"
                            android:layout_marginTop="3dip"
                            android:layout_toRightOf="@+id/list"
                            android:layout_marginLeft="57dip" 
                            />  

                     <TextView 
                            android:id="@+id/textView_location"
                            android:text="Hyderabad" 
                            android:layout_width="wrap_content" 
                            android:layout_height="wrap_content" 
                            android:layout_below="@+id/textView_time" 
                            android:layout_marginTop="10dip"
                            android:layout_marginRight="10dip"
                            android:layout_toRightOf="@+id/imageView_temp"
                            />

                           <TextView 
                            android:id="@+id/textView_temp"
                            android:text="35 Degrees" 
                            android:layout_width="wrap_content" 
                            android:layout_height="wrap_content" 
                            android:layout_below="@+id/textView_location"
                            android:layout_marginRight="10dip"
                            android:layout_marginTop="5dip"
                            android:layout_toRightOf="@+id/imageView_temp"
                            />

                       <ImageView android:id="@+id/imageView_temp"
                            android:src="@drawable/temp"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_below="@+id/textView_time"
                            android:layout_toRightOf="@+id/list"
                            android:layout_marginLeft="20dip"/>

                     <ImageView android:id="@+id/imageView_logo"
                            android:src="@drawable/zee"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="30dip"
                            android:layout_marginLeft="50dip"/>


                      <ImageView android:id="@+id/imageView_left"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:src="@drawable/arrow_left_gray"
                            android:layout_marginTop="110dip"
                            android:layout_marginLeft="23dip"/>

                        <TextView android:id="@+id/txt_channelName"
                            android:text="M-Tunes"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="110dip"
                            android:layout_marginLeft="50dip"/>

                        <ImageView android:id="@+id/imageView_right"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:src="@drawable/arrow_right_gray"
                            android:layout_marginTop="110dip"
                            android:layout_marginLeft="150dip"/>

                        <ListView android:id="@+id/list"
                            android:layout_width="690dip"
                            android:layout_height="125dip"
                            android:layout_below="@+id/progressBar"
                            android:layout_marginLeft="220dip"
                                            android:listSelector="@drawable/highlight_bar"/>  
                                <ImageView android:id="@+id/imageView_up"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:src="@drawable/arrow_up_gray"
                            android:layout_below="@+id/progressBar"
                            android:layout_marginTop="5dip"
                            android:layout_marginLeft="180dip"/>


                                </RelativeLayout>

        </FrameLayout>

    </FrameLayout>`

Row.xml

 <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      >
        <TextView android:text="TextView" 
            android:id="@+id/textView_list" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            />
    </LinearLayout>

And java code is like following

    ListView lv = (ListView) findViewById(R.id.list);
    String[] values = new String[] { "Now:Harry Potter and Deathly Hellows", "Lord of the Rings:Two Towers", "Lord of the Rings:Return of King",
                    "rd of the Rings:Honneypot solo Dance"};

            ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                    R.layout.row,R.id.textView_list, values);
            lv.setAdapter(adapter);
            lv.setSelector(R.drawable.highlight_bar);
            lv.setDivider(null);

If I am executing only listview with row xml code list selector working fine.
If I am pressing up and down arrows it’s working fine. But I am integrating
listview with above code it’s not working and if I am pressing up and arrows
in keyboard no use (focusing not going to listview side).

  • 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-27T15:51:17+00:00Added an answer on May 27, 2026 at 3:51 pm

    Have you tried calling “requestFocus()” on the listView in your code after setting android:focusable=”true” in the xml? From the View docs:

    “Call this to try to give focus to a specific view or to one of its descendants. A view will not actually take focus if it is not focusable (isFocusable() returns false), or if it is focusable and it is not focusable in touch mode (isFocusableInTouchMode()) while the device is in touch mode. See also focusSearch(int), which is what you call to say that you have focus, and you want your parent to look for the next one. This is equivalent to calling requestFocus(int, Rect) with arguments FOCUS_DOWN and null.”

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

Sidebar

Related Questions

I am creating a custom view which will have a bitmap so that user
When creating a view and setting group by value some field, it groups only
I am creating some build scripts that interact with Perforce and I would like
I am considering creating some JSP-tags that will always give the same output. For
I am creating some doubly linked list of type Double and no matter how
I am creating a list definition that includes three columns that are look-ups off
I am creating a JSF application. I have some items (e.g. products) from database
Hi I am trying to draw a complex view, defined by an xml layout
I have a custom SurfaceView defined in my layout xml. I can draw to
I'm having troubles with creating a simple list (some expandable lists are already working).

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.