When an Activity opens I need to set focus on one of two edit texts and automatically open the softkey pad so the user can just start typing. How can this be done?
Asked
Active
Viewed 1,208 times
0
-
I know its easier to click the minus button than answer but we need more constructive feedback. – Code Droid Jul 11 '12 at 21:44
-
Can someone else please + this so we don't get too negative! – Code Droid Jul 11 '12 at 21:45
-
If this is how you participate perhaps a SOCIAL network is not the right place.... I mean let us know what the pain point is. I really see nothing wrong with the question. – Code Droid Jul 11 '12 at 21:49
-
Look below to see social collaboration in action. – Code Droid Jul 11 '12 at 21:51
-
1Not sure how you get to the conclusion that [this is a social networking site](http://meta.stackexchange.com/questions/65261/is-stack-overflow-a-social-networking-site). What's wrong with this question? You don't show any research effort *(this has been answered often before)* or any attempt to solve this on your own. I guess if you don't do research on your problem, you won't check the meaning of downvotes either. See the downvote tooltip. And after you posted a lazy question, you complain that people pick the lazy option "downvote and move on"? I find that funny. – Jul 11 '12 at 22:25
-
It might not be the definition of a social network, but the point is that is people centered to solve (technical) problems. – Code Droid Jul 11 '12 at 22:51
-
Maybe, that's kind of subjective. Anyway the other issues are still there, so when it comes to beeing social: If you do people a favor and write a good question, people are more likely to do you a favor and actually help you. Waste their time with stuff that can be googled and they react like this. – Jul 11 '12 at 22:54
-
The waste of time is an illusion on your part. No ones time is wasted but perhaps mine and others is saved. An old answer to a question is not necessarily what people are looking for. Have you not heard of deprecation or backward compatibility issues. – Code Droid Jul 11 '12 at 23:02
-
deprecation you have probably heard of ... – Code Droid Jul 11 '12 at 23:03
-
Lovely. I'm completely sure that there are no compatibility issues in place and so on. Why did you even ask for an explanation when you didn't want to hear it anyway? I wonder why I even leave these comments - that was certainly a waste of time. – Jul 11 '12 at 23:10
1 Answers
3
In the xml for the layout, add <requestFocus />
under the EditText you want focused.

hcarver
- 7,126
- 4
- 41
- 67
-
-
Not without a bit more code. See http://stackoverflow.com/questions/5105354/how-to-show-soft-keyboard-when-edittext-is-focused – hcarver Jul 11 '12 at 21:45