title: java.lang.RuntimeException:Unable to start activity component info (Android)
body: <p>I am getting the following exception in my android code but i can't figure it out. I have extended my Home activity with <code>TabActivity</code> and receiving intents in it from <code>MainActivity</code>. In the tab3 i have passed intents to another activity which will start on selecting the tab3. The data from the intent is being received in that activity. I have checked it by Log. This received data will be shown in <code>ListView</code> of that activity. But unfortunately my app breaks down. Any help regarding this? <br>Here is my logcat.</p>
  
  <pre><code>01-24 14:36:34.880: E/AndroidRuntime(1147): FATAL EXCEPTION: main
  01-24 14:36:34.880: E/AndroidRuntime(1147): Process: com.example.app, PID: 1147
  01-24 14:36:34.880: E/AndroidRuntime(1147): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.Home1}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.CameraList}: java.lang.NullPointerException
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.ActivityThread.access$700(ActivityThread.java:135)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.os.Handler.dispatchMessage(Handler.java:102)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.os.Looper.loop(Looper.java:137)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.ActivityThread.main(ActivityThread.java:4998)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at java.lang.reflect.Method.invokeNative(Native Method)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at java.lang.reflect.Method.invoke(Method.java:515)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at dalvik.system.NativeStart.main(Native Method)
  01-24 14:36:34.880: E/AndroidRuntime(1147): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.CameraList}: java.lang.NullPointerException
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:2019)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:135)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:347)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:749)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.widget.TabHost.setCurrentTab(TabHost.java:413)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.widget.TabHost.addTab(TabHost.java:240)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at com.example.app.Home1.setNewTab(Home1.java:136)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at com.example.app.Home1.onCreate(Home1.java:83)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.Activity.performCreate(Activity.java:5243)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     ... 11 more
  01-24 14:36:34.880: E/AndroidRuntime(1147): Caused by: java.lang.NullPointerException
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at com.example.app.CameraList.onCreate(CameraList.java:40)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.Activity.performCreate(Activity.java:5243)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
  01-24 14:36:34.880: E/AndroidRuntime(1147):     ... 22 more
  </code></pre>
  
  <p>And this is the place where i used tabs in Home activity..</p>
  
  <pre><code>String [] names;
  names = intent.getStringArrayExtra("name");
      if(tag.equals("tab3"))
      {
          Intent ListIntent = new Intent(this, List.class);
          ListIntent.putExtra("itemName", names);
          tabSpec.setContent(ListIntent);
          tabHost.addTab(tabSpec);
      }
  </code></pre>
  
  <p>The activity where I recieve the intent in the OnCreate method:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.cam_list);
  
      //Log.i("cam","List");
  
      Intent intent = getIntent();
      name = intent.getStringArrayExtra("camName");
      //Log.i("cam", name[1]);
      url = intent.getStringArrayExtra("url");
  
      list = (ListView)findViewById(R.id.listView);
  
      ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,R.layout.cam_list,R.id.text1, name);
      list.setAdapter(adapter);
      /*list.setOnItemClickListener(new OnItemClickListener() {
  
           @Override
           public void onItemClick(AdapterView&lt;?&gt; parent, View view,
              int position, long id) {
  
                // ListView Clicked item value
                String  itemValue    = (String) list.getItemAtPosition(position);
                String camUrl = url[position];
  
                 // Show Alert 
                 Toast.makeText(getApplicationContext(),camUrl,Toast.LENGTH_LONG).show();
           }
      });*/
  }
  </code></pre>