Note that there are some explanatory texts on larger screens.

plurals
  1. POtextView marquee
    text
    copied!<p>I want to put a textView in homescreen, and I need the marquee effect</p> <pre><code>public class MainWidget extends AppWidgetProvider { int a; RemoteViews remoteViews; AppWidgetManager appWidgetManager; ComponentName thisWidget; String[] s={"woddfdfdfdfdfdffffffffffffffffffffffffffffffff","dd","ddd","ffff"}; public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Timer timer = new Timer(); timer.scheduleAtFixedRate(new WlanTimer(context, appWidgetManager), 100, 50000); } private class WlanTimer extends TimerTask { RemoteViews remoteViews; AppWidgetManager appWidgetManager; ComponentName thisWidget; public WlanTimer(Context context, AppWidgetManager appWidgetManager) { this.appWidgetManager = appWidgetManager; remoteViews = new RemoteViews(context.getPackageName(), R.layout.marketwidget_main); thisWidget = new ComponentName(context, MainWidget.class); } @Override public void run() { a=(int) (Math.random()*3); remoteViews.setTextViewText(R.id.TextView_marketwidget_main_marketmessage,s[a]); appWidgetManager.updateAppWidget(thisWidget, remoteViews); } } } </code></pre> <p>If i use s[0] instead s[a], it does not run, only "woddfdf" shows up.</p> <p>My textView xml is:</p> <pre><code> &lt;TextView android:id="@+id/TextView_marketwidget_main_marketmessage" android:maxLines="1" android:focusable="true" android:ellipsize="marquee" android:inputType="text" android:focusableInTouchMode="true" android:marqueeRepeatLimit="marquee_forever" android:textColor="#ffffff" android:background="@android:color/transparent" android:layout_width="80dip" android:layout_height="20dip"&gt;&lt;/TextView&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload