Dispatch KeyDown on Listview

by mihoelzl » Tue, 05 Apr 2011 23:07:32 GMT


Sponsored Links
 Hi,
I want to manually dispatch a key down event in a listactivity. This
works when I just add the Event to the Activity by:

this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN,
KeyEvent.KEYCODE_DPAD_DOWN));
this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP,
KeyEvent.KEYCODE_DPAD_DOWN));


I can now see that the cursor goes down and the next entry in the
listview is selected. But only the text is highlighted and not the
background (It stays black). What am I doing wrong? Any Idea?

BR
Michael

-- 



Other Threads

1. Sometimes get a blank screen on app restart

My application flow usually works like this:
Splashscreen calls user agreement
Success from user agreement makes Splashscreen call MapActivity
in MapActivity's onWindowFocusChanged(boolean hasFocus)
{
   if (hasFocus && firstStart)  // firstStart is static boolean
       //start another activity to call user details window
}


Now sometimes (but not always) when a user runs my app, goes back the
the 'desktop' with the home button, and then restarts my app later the
application will just display a blank screen.

Sometimes switching the orientation of the phone will cause the
display to work.  Sometimes it takes switching the orientation a few
times to cause the display to work.  Hitting the back button will kill
the offending activity which is either the user agreement or the user
detail window and the application will continue as normal correctly
displayed.

I am looking for suggestions for what I might be doing wrong or how I
can assure my activities will display when they come up.
--~--~---------~--~----~------------~-------~--~----~

2. Sprint Android Phone

I was over looking at Sprint's developer site and noticed they have 
information on their Android phone and the forum has a section which 
apparently opened today.
http://developer.sprint.com/site/global/develop/technologies/android/p_android.jsp

The phone is supposed to be available October 11th.

- Brian



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

3. Externalize strings automatically

4. Debug certificate has expired!

5. A bug with android 1.5 when deleting a phone using delete()

6. AppWidget efficiency

7. Configuring camera at Android device emulator?