Created
July 18, 2012 14:46
-
-
Save takuya-i/3136619 to your computer and use it in GitHub Desktop.
[android] force set forcus to View object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* android snippet | |
* Force set forcus to View object.Somtimes this is not effected | |
* | |
* @param v View instance object of set forcus | |
*/ | |
public void foceSetFocus(View v) { | |
v.setFocusable(true); | |
v.setFocusableInTouchMode(true); | |
if (!v.requestFocus()) { | |
v.requestFocusFromTouch(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment