Here is a code for which I face the Exception
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);
}
}
On line tv.setText(value1 + " At " + value2); I face Null pointer Exception like this
**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)**
Can you help me?