I have a tabHost `MainActivity` and two A, B activities. In each Tabs I want to transport a string called cityName from MainActivity to A activity. But I always got a `NullPointerException` in Logcat and be forced close T.T

Here is my code:

```
public class MainActivity extends TabActivity {

private static TabHost tabHost;
public static String selectedCity;
Bundle selectedCityBundle = new Bundle();
Intent selectedCityIntent = new Intent();

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Resources res = getResources();
    selectedCityBundle.putString("CityName", "LA");
    selectedCityIntent.setClass(this, A.class);
    selectedCityIntent.putExtras(selectedCityBundle);
    tabHost = getTabHost();     
    TabHost.TabSpec spec;
    Intent intent;
    intent = new Intent().setClass(this, A.class);
    spec = tabHost.newTabSpec("tab1")
            .setIndicator("A", res.getDrawable(R.drawable.start))
            .setContent(intent);
    tabHost.addTab(spec);

    intent = new Intent().setClass(this, B.class);
    spec = tabHost.newTabSpec("tab2")
            .setIndicator("B", res.getDrawable(R.drawable.weather))
            .setContent(intent);
    tabHost.addTab(spec);

    tabHost.setCurrentTab(0);

}

```

**Class A**

```
public class A extends Activity {

TextView tempNum, cn1, cn2, cn3, ln1, ln2, ln3, city, rainProb;
Intent cityIntent = new Intent();
Bundle cityBundlecityBundle = cityIntent.getExtras();

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.start);
    tempNum = (TextView) findViewById(R.id.temp);
    rainProb = (TextView) findViewById(R.id.raining);
    cn1 = (TextView) findViewById(R.id.zone1News1);
    cn2 = (TextView) findViewById(R.id.zone1News2);
    cn3 = (TextView) findViewById(R.id.zone1News3);
    ln1 = (TextView) findViewById(R.id.zone2News1);
    ln2 = (TextView) findViewById(R.id.zone2News2);
    ln3 = (TextView) findViewById(R.id.zone2News3);
    city = (TextView) findViewById(R.id.location);      
    city.setText(cityBundle.getString("CityName"));
    //Always got error NullPointerException here
}

}

```