android - How to have a auto scrollable TextView -


I'm trying to scroll an automated Android app.

Suppose I have an XML code like this:

   & Lt; ScrollView Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" & gt; & Lt; TextView android: layout_width = "fill_parent" android: layout_height = "wrap_content" android: text = "@ string / text" android: id = "@ + id / textView1" /> & Lt; / Scrollview & gt; & Lt; / LinearLayout & gt;  

In this XML code I have a button at the top of the screen and a TextView, which is wrapped by ScrollView. This means that my TextView is scrollable.

This works correctly, because when the user touches the screen and swaps up or down, TextView can be scrolled up and down.

But ...

I intend that with an auto-scrollable text view and auto I mean, I need a scrollable text body, which is 10 seconds Scrolls after 10 seconds after

I know that I want to use some threads in my application to count the time, but for example, after 10 seconds I can not say how to scroll textView.

Any suggestions? Any sign will be appreciated thanks

You can use some things:

  mScrollView.post (new runleback) {public run zero () {mScrollView.smoothScrollBy (10, 10);}});  

Documentation for smoothScrollBy:

To execute this task for every 10seconds:

  TimerTace file processTags = New timer cookies () {@Override Public Zero Run () {// Scrolling Here}}; Timer TM = new timer (); Tm.schedule (File Process Tasks, 10000 L);  

Also look at this SO post: I have not tried to do this but you can try it.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -