Android: Null Pointer Exception at Text View
<p>Here is a code for which I face the Exception</p>

<pre><code>public class SHOSuper extends Activity{

String officerName;
String arr[];
String[] offN;
public void onCreate(Bundle savedInstanceState) {
    try{
        super.onCreate(savedInstanceState);
        final TextView tv;
        tv=(TextView)findViewById(R.id.txt1);
        System.out.println("I AM NEW ACTIVITY");
        arr=Receiver.split(Receiver.orignal, ","); 
        String value1= arr[1];
        System.out.println("Array index " + value1);
        String value2=arr[2];
        System.out.println("Array 2nd index " + value2);
        tv.setText(value1 + " At " + value2);
        officerName= arr[5];
        offN =new String[officerName.length()];
        offN=Receiver.split(officerName, "_");
    }
    catch(Exception e){
        e.printStackTrace();
    }

setContentView(R.layout.main);
  }
}
</code></pre>

<p>On line <code>tv.setText(value1 + " At " + value2);</code> I face Null pointer Exception like this</p>

<pre><code>**04-12 13:25:18.105: WARN/System.err(527): java.lang.NullPointerException
04-12 13:25:18.265: WARN/System.err(527):     at com.sho.SHOSuper.onCreate(SHOSuper.java:24)**
</code></pre>

<p>Can you help me? </p>
