Broadcast Intent for Clicking inside a TextView or EditText

Put your problem here if it does not fit any of the other categories.

Broadcast Intent for Clicking inside a TextView or EditText

Postby fuzzlog » Wed Apr 28, 2010 6:41 am

Is there a Broadcast Intent that gets sent out when the the user clicks inside a TextView or EditText?

For example, how does the android keyboard pop up when the user clicks inside either a TextView or EditText within an application (regardless of the application)?

fuzzlog
fuzzlog
Freshman
Freshman
 
Posts: 4
Joined: Tue Feb 02, 2010 5:00 am

Top

Postby nicholas.hauschild » Wed Apr 28, 2010 1:14 pm

Hello fuzzlog,

Most (if not all) View objects and its descendants should have a method called setOnFocusChangedListener(View.OnFocusChangedListener)

If you implement an OnFocusChangedListener you should be able to bring up the keyboard in its onFocusChanged() method.

Good Luck
-Nick
nicholas.hauschild
Master Developer
Master Developer
 
Posts: 310
Joined: Fri Dec 04, 2009 4:50 am

Postby fuzzlog » Thu Apr 29, 2010 5:38 am

Nicholas,

Thanks for your reply, but that's not what I'm looking for. What I meant to say by "(regardless of the application)" is that i would like to capture a system-wide broadcast which occurs when the EditText/TextView gets focus whether the application is written by me, or by someone else (3rd party app).

An example would be an application such as "Swipe". If you've ever used that app, you know that once the app is enabled, whenever the user clicks inside an EditText or TextView, the "Swipe" keyboard pops up instead of the android keyboard. So how does the Swipe app know that the user just clicked inside the EditText / TextView?

Thanks,

fuzzlog
fuzzlog
Freshman
Freshman
 
Posts: 4
Joined: Tue Feb 02, 2010 5:00 am

Postby pskink » Thu Apr 29, 2010 7:13 am

this is because Swipe app implements std android input method (virtual keyboard)
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby fuzzlog » Fri Apr 30, 2010 5:11 am

pskink,

Awesome answer! those three key words (android input method) led me to this link. http://android-developers.blogspot.com/2009/04/creating-input-method.html, which is exactly what I was looking for.

Thanks!

fuzzlog
fuzzlog
Freshman
Freshman
 
Posts: 4
Joined: Tue Feb 02, 2010 5:00 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 22 guests