1

I have 2 activities, A1 and A2.

My application opens in Activity A1. None of the views in A1 are focused at startup, until I use the arrow keys to navigate through the views.

A button press in A1 launches activity A2.

When A2 opens, the first Button in A2 is focused by default. I do not want this happen. What I want is when A2 opens, none of the buttons are focused until arrow keys are used to naviagte through them(just like it is in A1).

Any idea how I can achieve this?

kiki
  • 13,627
  • 17
  • 49
  • 62
  • 1
    check this question: http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup It may help. – Maragues Oct 05 '10 at 07:04
  • @Maragues: I went through the example. It says to create a dummy layout to steal the initial focus. But are you sure there can't be any easier means of doing this? – kiki Oct 08 '10 at 05:39
  • I'd say it's an android bug. Trust me, I spent a lot of time trying to solve the problem until I read that answer. In my case it was TextViews gaining focus when they shouldn't. I'd recommend to stick to that ugly solution until they fix it. – Maragues Oct 08 '10 at 08:14
  • Maybe you can give me the link as an answer which I could accept. Comment leaves the question unanswered...:) – kiki Oct 13 '10 at 11:12

1 Answers1

0

See the answer to this question for a solution: Stop EditText from gaining focus at Activity startup

Community
  • 1
  • 1
kiki
  • 13,627
  • 17
  • 49
  • 62