Default focus on RelativeLayout

by devileper » Sun, 12 Apr 2009 05:10:46 GMT


Sponsored Links
 How can you specify which item gets the default focus on Activity
startup?  Using requestFocus programmatically does not work. On
setContextView the first focusable item listed in the XML is given the
default focus. When using RelativeLayout, the first item listed is not
always the desired item or necessarily on top.
--~--~---------~--~----~------------~-------~--~----~



Default focus on RelativeLayout

by Mark Murphy » Sun, 12 Apr 2009 09:01:15 GMT


 


API samples show requestFocus() working in onCreate(), so I am not
certain where your problem lies.

For example:

 http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.html 

If you cannot figure out the problem, post some sample code illustrating
how you are trying requestFocus(), and perhaps we can see the problem.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android App Developer Training:  http://commonsware.com/training.html 

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


Sponsored Links


Default focus on RelativeLayout

by Ward Willats » Sun, 12 Apr 2009 23:00:29 GMT


 




I have had good luck with requestFocus() in most cases 
(RelativeLayout or otherwise) I've run into trouble where:

1. The focused item was in a ScrollView and caused the view to scroll 
unexpectedly -- confusing me!

2. The activity had a TabHost on it -- the TabHost seems to always 
steal the focus sometime after onCreate(). I've never figured out a 
way around this.

-- Ward

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



Other Threads

1. Abridged summary of android-developers@googlegroups.com - 84 Messages in 39 Topics

Hi guys i want to know ..how can we develop android application...please
give me info ..about that...please

-- 

2. android's radio transmitter API?

How can I make the android phone to transmit a 32-bit binary number at
a specific frequency say 915MHz. without using the 2G/3G network?
Essentially making it as a simple radio transmitter, I don't even want
to use the 2G/3G spectrum, but a frequency close to so that the phone
is still capable of.

Are there APIs available to let control of the phone's internal
transceiver?

-- 

3. Browser screen flickering

4. Banting harga WTS : HTC Magic 2nd

5. How to make a backwards compatible aidl?

6. program push email untuk spica

7. (WTA) rekomendasi HH