I have created a marquee text using TextView in android. My requirement is to flush the shown text in the marquee and append new text to it. How to flush the shown text?
Asked
Active
Viewed 619 times
2 Answers
0
You can use
setMarqueeRepeatLimit (int marqueeLimit)
set to 1 and add new text by appending new one DO this for each time you append new text and set to -1 when finished.

Hanry
- 5,481
- 2
- 40
- 53
-
@sangita You can refer to: [link](http://stackoverflow.com/questions/1827751/is-there-a-way-to-make-ellipsize-marquee-always-scroll) – Hanry Apr 12 '11 at 06:45
0
@Hanry You are right but i think it will marquee only if it gains focus.. i had this problem earlier.. what i did is replaced the textview with webview and used marquee tag to make the text scroll.
Edit : Response to sangita
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setDefaultFontSize(26);
webview.setBackgroundColor(R.color.Black);
webview.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
//DO actions here
}
});
String content = "MARQUEE TEST";
String summary = "<html><FONT color='#fdb728' FACE='courier'><marquee behavior='scroll' direction='left' scrollamount=10>"
+ content + "</marquee></FONT></html>";
webview.loadData(summary, "text/html", "utf-8");

Jana
- 2,890
- 5
- 35
- 45
-
-
-
-
modifying variable "content" will naturally append or modify displaying content – Jana Apr 14 '11 at 04:40