How to go to the top of an Activity on Android

Asked

Viewed 278 times

2

I am developing a Java project for Android that is a Quiz and every time I go to the next question I visualize the radio Buttons and would like to position the screen at the top, so that the user can start reading.

tela1

tela2

1 answer

1

You can go to the top of your ScrollView "smoothly":

suaScrollView.smoothScrollTo(0,0); 

Or:

suaScrollView.scrollTo(0,0); 

Browser other questions tagged

You are not signed in. Login or sign up in order to post.