Items in ListView don't get selected using touch

by Yousuf Haider » Sat, 20 Jun 2009 09:35:03 GMT


Sponsored Links
 Hi,

I have a relative layout which contains 2 things. Something like this:

RelativeLayout:
    ---LinearLayout
        --Some buttons
        --TextView
    --ListView

If I use the trackball to scroll I can select items in my list view. However
if I try to touch an item to select it the item doesn't get selected.

Any ideas ?

_yousuf

--~--~---------~--~----~------------~-------~--~----~



Items in ListView don't get selected using touch

by Odessa Silverberg » Mon, 22 Jun 2009 16:40:24 GMT


 Did you tried playing with

android:clickable/setClickable(boolean)
 http://developer.android.com/reference/android/view/View.html #attr_android:clickable

android:focusable/setFocusable(boolean)
 http://developer.android.com/reference/android/view/View.html #attr_android:focusable

or

android:focusableInTouchMode/setFocusableInTouchMode(boolean)
 http://developer.android.com/reference/android/view/View.html #attr_android:focusableInTouchMode





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. FrameLayout and margins

I have the following piece of code but the margins are not set.

main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:orientation="vertical" android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <FrameLayout android:id="@+id/MainLayout01"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">
        </FrameLayout>
</LinearLayout>


setContentView(R.layout.main);
ImageView image1 = new ImageView(this);
image1.setImageResource(R.drawable.alien_256);
FrameLayout frl = (FrameLayout) this.findViewById(R.id.MainLayout01);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
                                FrameLayout.LayoutParams.WRAP_CONTENT,
                                FrameLayout.LayoutParams.WRAP_CONTENT);
params.leftMargin=50;
params.topMargin=40;
frl.addView(image1, params);

I have also tried using the params.setMargins(50, 40, 0, 0) but it
does not work either.

Any suggestion? (Absolute layout works just fine, too bad it was
deprecated)
--~--~---------~--~----~------------~-------~--~----~

2. Selecting text in a WebView?

The browser does this by calling `public void emulateShiftHeld()`
method on the WebView which is hidden in the SDK.
Any other options?
TIA.
--~--~---------~--~----~------------~-------~--~----~

3. UI changing layouts

4. Can adb shell trigger onLowMemory

5. USB data acquisition

6. Unable to read camera input buffer

7. Can't delete emails?