Dispatch KeyDown on Listview

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

Sponsored Links
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,
this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP,

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?



Other Threads

1. Problem with gridview refresh


I made a simple game called "taquin" in french, here you can see an
example of this game (it's not mine) : 

In my game the numbers are replaced by picture's fragments (object
Bitmap), when I do movements by myself (by clicking on a picture
fragment) the refresh of the gridview works. But when the movements
are automatics (I made an heuristic function to solve the game) the
refresh doesn't work at each movement...

To refresh the gridview I call the method "notifyDataSetChanged()" on
the object of my class ImageAdapter (extends BaseAdapter) which has
the gridview as attribute. I put a "Thread.sleep(500)" after each
"notifyDataSetChanged()", the "sleep" works beacause it delays the
game solving but the view is not refreshed.

Do you have an idea to fix this problem ?


2. Extendind Contacts application


Do you know if there is a way to extend native contacts applications.
I mean if there is any plugin framework that would allow you to add
tour own stuff into the contacts e.g. new tabs or menu commands. I
remember there was such thing in Symbian (via ECOM plugins). I briefly
checked the Contacts source code but could not find any trace of such


3. trouble with programmatically adding mock location data

4. Should we still force our apps to API level 2?

5. Streetview intent question

6. Location based problem in emulator

7. How to redirect the Logs into an file.