Using List View with bluetooth remote
<p>After literally 1 1/2 hours of searching I found a list view example that actually ran on stackoverflow.  No such luck on Google tutorial at least for me and most of what people refer to on there is apparently long replaced with one that does not compile.  Anyway, I got it to work.  Then I added my code to allow my bluetooth clicker to work.  No joy.</p>

<p>I need to control the tablet without touching it. It will be behind glass and I want a ESC code to advance through my buttons or list and another button to execute what is highlighted.  A simple two button interface to my application.  The application is working but I want to add a feature that requires the user select from an indeterminate list of locations (user supplied).  So seemed like a list was a good idea.  The list works but when I put my bluetooth interceptor code in, it won't scroll even manually.  After three hours of trying to figure out if a list is the right solution for my problem, I am asking for help.</p>

<pre><code>package com.example.listview2;
import android.app.Instrumentation;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.ArrayAdapter;

public class HelloListView extends ListActivity {
String[] listItems = {"item 1", "item 2 ", "list","item 1", "item 2 ", "list","item 1",         "item 2 ", "list", "android", "item 3", "foobar", "bar", }; 
@Override
 public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.temp);
     setListAdapter(new ArrayAdapter(this,  android.R.layout.simple_list_item_1, listItems));
 }

@Override
public boolean dispatchKeyEvent(KeyEvent ke){
    int keyCode = ke.getKeyCode();
    if(ke.getAction() == KeyEvent.ACTION_DOWN){
        switch (keyCode)
        {

            case 59:

                return true;
            case 19:
                new Thread(new Runnable() {         
                    @Override
                    public void run() {                 
                        new Instrumentation().sendKeyDownUpSync(KeyEvent.KEYCODE_TAB);
                    }   
                }).start();
                return true;
            case 20:
                new Thread(new Runnable() {         
                    @Override
                    public void run() {                 
                        new Instrumentation().sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_CENTER);
                    }   
                }).start();
                return true;
        }
    }
    else if(ke.getAction() == KeyEvent.ACTION_UP){
        switch (keyCode){
            case 59:
            case 19:
            case 20:
                return true;
        }
    }

    return super.dispatchKeyEvent(ke);
}   
</code></pre>

<p>}</p>

<p>The XML is:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"&gt;
&lt;ListView android:id="@+id/ListView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /&gt;
&lt;/LinearLayout&gt;
</code></pre>
