1. Check out our companion app, Forums for Android! Download from Google Play

Persistent Error!

Discussion in 'Application Development' started by Lijap, Jun 27, 2011.

  1. Lijap

    Lijap Member
    Thread Starter
    15

    Jun 16, 2011
    15
    0
    15
    this is my code and the line with private TabSpec tsTabTwo; says The field DriverBuddy.tsTabTwo is never read locally and the line with tsTabTwo.setContent(R.id.TabTwo); has the error of TabTwo cannot be resolved or is not a field, please help, I have tried everything!
    *Warning its probably going to be a stupid error on my part:eek:*




    package com.lijap.DriverBuddy;
    import com.lijap.DriverBuddy.R;
    import android.app.TabActivity;
    import android.content.res.Resources;
    import android.os.Bundle;
    import android.widget.TabHost;
    import android.widget.TabHost.TabSpec;

    public class DriverBuddy extends TabActivity {
    private TabSpec tsTabTwo;

    /** Called when the activity is first created. */
    @SuppressWarnings("null")
    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    /* TAB #1 */
    TabHost mTabHost = null;
    TabSpec tsTabOne = mTabHost.newTabSpec("TabOne");
    TabSpec tsBrand = null;
    tsBrand.setIndicator("Tab One", ((Resources) getResources()).getDrawable(R.drawable.tab_one));
    tsTabOne.setContent(R.id.TabOne);

    /* TAB #2 */
    TabHost mTabHost1 = null;
    TabSpec tsTabTwo = mTabHost1.newTabSpec("TabTwo");
    TabSpec tsBrand1 = null;
    tsBrand1.setIndicator("Tab Two", ((Resources) getResources()).getDrawable(R.drawable.tab_two));
    tsTabTwo.setContent(R.id.TabTwo);

    /* Create TabHost */
    TabHost mTabHost11;
    mTabHost11 = getTabHost();
    /* Add Tabs to TabHost */
    mTabHost11.addTab(tsTabOne);
    mTabHost11.addTab(tsTabTwo);
    /* If you have more ... */
    mTabHost11.setCurrentTab(0);

    }

    }
     

    Advertisement

  2. Lijap

    Lijap Member
    Thread Starter
    15

    Jun 16, 2011
    15
    0
    15
  3. Lijap

    Lijap Member
    Thread Starter
    15

    Jun 16, 2011
    15
    0
    15
    BUMP, PLEASE help me, I have not been able to figure this out still and its been over a week!
     

Share This Page

Loading...