I'm trying to implement marquee textview in a fragment at the runtime.

**Problem #1:** I get a null pointer exception at `tv.setSelected(true);` on the first fragment.
Everything works ok until I put the marquee code for the text view. 

**Problem #2:** How can I move to a new fragment instead of a new intent in the list view for `public void onItemClick` ?

This is my code:

```
 public static class FragmentOne extends Fragment {

 ArrayList< String > ar;
 ArrayAdapter< String >  ad ;
 ListView lv ;
 TextView     tv;

public FragmentOne() {
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle        
         savedInstanceState) {
     View rootView = inflater.inflate(R.layout.one, container, false);
          tv = (TextView) rootView.findViewById(R.id.textView1);  

        tv.setSelected(true);
     ar = new ArrayList<String>(); 
     lv = (ListView) rootView.findViewById(R.id.listView1); 
     for (int i = 0 ; i< 10  ; i++){

        ar.add("My Item " + String.valueOf(i)); 

      }
      ad = new ArrayAdapter<String>
     (getActivity().getApplicationContext(), android.R.layout.simple_dropdown_item_1line, 
             ar);

     lv.setAdapter(ad);
     lv.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View view,
                    int position, long id) {
                          Toast t = Toast.makeText(getActivity(), "Message",
                                 Toast.LENGTH_SHORT);
                          t.show();

                        Intent i = new Intent(getActivity(), tst.class); 

                        startActivity(i); 

            }
        }); 

    return rootView;
}

```

}

this is the xml code :

```
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TextView
    android:id="@+id/mywidget"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="94dp"
    android:layout_marginTop="145dp"
    android:ellipsize="marquee"
    android:fadingEdge="horizontal"
    android:lines="2"
    android:marqueeRepeatLimit="marquee_forever"
    android:scrollHorizontally="true"
    android:text="صور أندلسية ..... صفحة الأندلس ....معارك  أندلسية ..... الأندلس في سطور    
     ..... الأندلس :  "
    android:textColor="#ff4500"
    android:focusable="false" />

  </RelativeLayout>

```