question

sipahi avatar image
sipahi asked

How to Set Focus on an Item in the Action Bar on Launch

I had developed an Android app that works fine on smartphones. When trying on Amazon Fire TV, I see that no view has focus on launch and the key presses on the remote controller don't have any effect. How can I make an item on the action bar have focus (the action item should have focus, namely blue lines around it). Since no view seems to have focus, the remote controller does not work. Do I have to add something to the layout code, which is as follows: ... ... ... or do I have to set focus programmatically in onCreate or onStart?
fire tv
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Nick Gardner avatar image
Nick Gardner answered
If you want to set the initial focus for the application, you can use requestfocus: http://developer.android.com/guide/topics/resources/layout-resource.html#requestfocus-element
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.