• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Persistent Error!

Lijap

Newbie
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:o*




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);

}

}
 
Back
Top Bottom