Created
July 31, 2015 01:45
-
-
Save thanhcs94/4149c95aeb7960194fbd to your computer and use it in GitHub Desktop.
Android ScrollView setting focus on top
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
Instead of: | |
ScrollView main = (ScrollView) findViewById(R.id.main); | |
main.scrollTo(0,0); | |
I used: | |
final ScrollView main = (ScrollView) findViewById(R.id.main); | |
main.post(new Runnable() { | |
public void run() { | |
main.scrollTo(0,0); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment