Android Vertical Tab Layout-Collection of common programming errors

I keep getting this error on running but no compile errors? here is the logcat and code for main.

05-25 12:29:25.543: W/dalvikvm(384): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
05-25 12:29:25.582: E/AndroidRuntime(384): FATAL EXCEPTION: main
05-25 12:29:25.582: E/AndroidRuntime(384): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.tablayout/com.example.tablayout.TablayoutActivity}: java.lang.NullPointerException
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.os.Looper.loop(Looper.java:123)
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.app.ActivityThread.main(ActivityThread.java:4627)
05-25 12:29:25.582: E/AndroidRuntime(384):  at java.lang.reflect.Method.invokeNative(Native Method)
05-25 12:29:25.582: E/AndroidRuntime(384):  at java.lang.reflect.Method.invoke(Method.java:521)
05-25 12:29:25.582: E/AndroidRuntime(384):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-25 12:29:25.582: E/AndroidRuntime(384):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-25 12:29:25.582: E/AndroidRuntime(384):  at dalvik.system.NativeStart.main(Native Method)
05-25 12:29:25.582: E/AndroidRuntime(384): Caused by: java.lang.NullPointerException
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.app.Activity.setContentView(Activity.java:1647)
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.app.TabActivity.ensureTabHost(TabActivity.java:114)
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.app.TabActivity.getTabHost(TabActivity.java:136)
05-25 12:29:25.582: E/AndroidRuntime(384):  at com.example.tablayout.TablayoutActivity.(TablayoutActivity.java:15)
05-25 12:29:25.582: E/AndroidRuntime(384):  at java.lang.Class.newInstanceImpl(Native Method)
05-25 12:29:25.582: E/AndroidRuntime(384):  at java.lang.Class.newInstance(Class.java:1429)
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-25 12:29:25.582: E/AndroidRuntime(384):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
05-25 12:29:25.582: E/AndroidRuntime(384):  ... 11 more






    
    
     
    
    
        
            
            
            
     
           
    
    
    

here is the main.java file, this way you can see how it was a global variable and where i removed it from. Also added the buttons globally instead of locally to that one spot.

    import android.app.TabActivity;
    import android.content.Intent;
   import android.os.Bundle;
   import android.view.View;
   import android.widget.Button;
   import android.widget.TabHost;
   import android.widget.TabHost.TabSpec;

   public class TablayoutActivity extends TabActivity {
    /** Called when the activity is first created. */

Button artistButton, songButton, videosButton;
TabHost tabHost = getTabHost();

@Override
     public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    //TabHost tabHost = getTabHost();

    // Tab for Photos
    TabSpec photospec = tabHost.newTabSpec("Photos");
    // setting Title and Icon for the Tab
    photospec.setIndicator("Photos",   getResources().getDrawable(R.drawable.icon_photos_tab));
    Intent photosIntent = new Intent(this, PhotosActivity.class);
    photospec.setContent(photosIntent);

    // Tab for Songs
    TabSpec songspec = tabHost.newTabSpec("Songs");
    songspec.setIndicator("Songs", getResources().getDrawable(R.drawable.icon_songs_tab));
    Intent songsIntent = new Intent(this, SongsActivity.class);
    songspec.setContent(songsIntent);

    // Tab for Videos
    TabSpec videospec = tabHost.newTabSpec("Videos");
    videospec.setIndicator("Videos",         getResources().getDrawable(R.drawable.icon_videos_tab));
    Intent videosIntent = new Intent(this, VideosActivity.class);
    videospec.setContent(videosIntent);

    // Adding all TabSpec to TabHost
    tabHost.addTab(photospec); // Adding photos tab
    tabHost.addTab(songspec); // Adding songs tab
    tabHost.addTab(videospec); // Adding videos tab




   }

    public void tabHandler(View target){
    artistButton.setSelected(false);
    videosButton.setSelected(false);
    songButton.setSelected(false);
    if(target.getId() == R.id.artist_id){
        tabHost.setCurrentTab(0);
        artistButton.setSelected(true);
    } else if(target.getId() == R.id.album_id){
        tabHost.setCurrentTab(1);
        videosButton.setSelected(true);
    } else if(target.getId() == R.id.song_id){
        tabHost.setCurrentTab(2);
        songButton.setSelected(true);
    }
   };

    }