title: Start marquee after touch event in android
body: <p>I have one Linear Layout which contains three List Views and Three Buttons. I have customized the List View elements. I just want that if anyone touches the element of a List View then the corresponding text view should give effect as a marquee. </p>
  
  <p>The main Linear Layout is as below -</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:gravity="center"
  android:orientation="vertical" &gt;
  
  &lt;ListView
      android:id="@+id/list1"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_marginLeft="5dip"
      android:layout_marginRight="5dip"
      android:layout_marginTop="5dip"
      android:layout_weight="1"
      android:drawSelectorOnTop="false"
      android:textSize="16dip" /&gt;
  
  &lt;Button
      android:id="@+id/more_button1"
      android:layout_width="130dip"
      android:layout_height="wrap_content"
      android:layout_marginLeft="5dip"
      android:layout_marginRight="5dip"
      android:layout_marginTop="5dip"
      android:text="More" &gt;
  &lt;/Button&gt;
  
  &lt;ListView
      android:id="@+id/list2"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_marginLeft="5dip"
      android:layout_marginRight="5dip"
      android:layout_marginTop="5dip"
      android:layout_weight="1"
      android:drawSelectorOnTop="false"
      android:textSize="16dip" /&gt;
  
  &lt;Button
      android:id="@+id/more_button2"
      android:layout_width="130dip"
      android:layout_height="wrap_content"
      android:layout_marginLeft="5dip"
      android:layout_marginRight="5dip"
      android:layout_marginTop="5dip"
      android:text="More" &gt;
  &lt;/Button&gt;
  
  &lt;ListView
      android:id="@+id/list3"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_marginLeft="5dip"
      android:layout_marginRight="5dip"
      android:layout_marginTop="5dip"
      android:layout_weight="1"
      android:drawSelectorOnTop="false"
      android:textSize="16dip" /&gt;
  
  &lt;Button
      android:id="@+id/more_button3"
      android:layout_width="130dip"
      android:layout_height="wrap_content"
      android:layout_marginLeft="5dip"
      android:layout_marginRight="5dip"
      android:layout_marginTop="5dip"
      android:text="More" &gt;
  &lt;/Button&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Customized List Items are as below (list_item_1, list_item_2, list_item_3)- </p>
  
  <pre><code>&lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:ellipsize="marquee"
  android:focusableInTouchMode="true"
  android:freezesText="true"
  android:lines="1"
  android:marqueeRepeatLimit="marquee_forever"
  android:padding="10dp"
  android:scrollHorizontally="true"
  android:scrollbarAlwaysDrawVerticalTrack="false"
  android:singleLine="true"
  android:textSize="20sp" &gt;
  
  &lt;/TextView&gt;
  </code></pre>
  
  <p>And the activity is as below - </p>
  
  <pre><code>public class MarqueeActivity extends Activity {
  
  ListView lv1 = null;
  ListView lv2 = null;
  ListView lv3 = null;
  
  String s1[] = {"Hello This is a long Text which will help in tsting", "How", "Are", "You"};
  String s2[] = {"I", "Am", "Fine"};
  String s3[] = {"Welcome", "In", "New", "World"};    
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      lv1 = (ListView) findViewById(R.id.list1);
      lv2 = (ListView) findViewById(R.id.list2);
      lv3 = (ListView) findViewById(R.id.list3);
  
      lv1.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item_1, s1));
      lv2.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item_2, s2));
      lv3.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item_3, s3));
  
      }
  }
  </code></pre>
  
  <p>For e.g. If the activity is started and then someone touches the first element in first list view (Hello This is a long Text which will help in testing) then it should start marquee.</p>
  
  <p>Thanks in advance!!</p>