1

I am trying create a simple tab activity using GreenDroid, below is my code

public class TabBarActivity extends GDTabActivity {

    private static final String TAB1 = "tab_one";
    private static final String TAB2 = "tab_two";
    private static final String TAB3 = "tab_three";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setTitle("Screen 2");

        Intent intent = new Intent(this, JobActivity.class);
        addTab(TAB1, "Tab One", intent);

        intent = new Intent(this, ContactListActivity.class);    
        addTab(TAB2, "Tab Two", intent);

        intent = new Intent(this, ParentActivity.class);
        addTab(TAB3, "Tab Three", intent);
    }


}

I am getting following error...

09-11 11:18:37.571: W/dalvikvm(20395): threadid=1: thread exiting with uncaught exception (group=0x40ee9438) 09-11 11:18:37.601: E/AndroidRuntime(20395): FATAL EXCEPTION: main 09-11 11:18:37.601: E/AndroidRuntime(20395): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cybergeniesolutions.bb/com.cybergeniesolutions.bb.TabBarActivity}: android.view.InflateException: Binary XML file line #27: Error inflating class greendroid.widget.ActionBar 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2114) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2139) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.app.ActivityThread.access$700(ActivityThread.java:143) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1241) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.os.Handler.dispatchMessage(Handler.java:99) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.os.Looper.loop(Looper.java:137) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.app.ActivityThread.main(ActivityThread.java:4963) 09-11 11:18:37.601: E/AndroidRuntime(20395): at java.lang.reflect.Method.invokeNative(Native Method) 09-11 11:18:37.601: E/AndroidRuntime(20395): at java.lang.reflect.Method.invoke(Method.java:511) 09-11 11:18:37.601: E/AndroidRuntime(20395): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038) 09-11 11:18:37.601: E/AndroidRuntime(20395): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) 09-11 11:18:37.601: E/AndroidRuntime(20395): at dalvik.system.NativeStart.main(Native Method) 09-11 11:18:37.601: E/AndroidRuntime(20395): Caused by: android.view.InflateException: Binary XML file line #27: Error inflating class greendroid.widget.ActionBar 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.view.LayoutInflater.createView(LayoutInflater.java:619) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:693) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.view.LayoutInflater.rInflate(LayoutInflater.java:752) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.view.LayoutInflater.inflate(LayoutInflater.java:495) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 09-11 11:18:37.601: E/AndroidRuntime(20395): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:318) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.app.Activity.setContentView(Activity.java:1924) 09-11 11:18:37.601: E/AndroidRuntime(20395): at greendroid.app.GDTabActivity.onCreate(GDTabActivity.java:52) 09-11 11:18:37.601: E/AndroidRuntime(20395): at com.cybergeniesolutions.bb.TabBarActivity.onCreate(TabBarActivity.java:18) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.app.Activity.performCreate(Activity.java:5184) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2078) 09-11 11:18:37.601: E/AndroidRuntime(20395): ... 11 more 09-11 11:18:37.601: E/AndroidRuntime(20395): Caused by: java.lang.reflect.InvocationTargetException 09-11 11:18:37.601: E/AndroidRuntime(20395): at java.lang.reflect.Constructor.constructNative(Native Method) 09-11 11:18:37.601: E/AndroidRuntime(20395): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.view.LayoutInflater.createView(LayoutInflater.java:593) 09-11 11:18:37.601: E/AndroidRuntime(20395): ... 23 more 09-11 11:18:37.601: E/AndroidRuntime(20395): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f01002a a=-1} 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.content.res.Resources.loadDrawable(Resources.java:2239) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.content.res.TypedArray.getDrawable(TypedArray.java:601) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.view.View.(View.java:3419) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.view.ViewGroup.(ViewGroup.java:432) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.widget.LinearLayout.(LinearLayout.java:176) 09-11 11:18:37.601: E/AndroidRuntime(20395): at android.widget.LinearLayout.(LinearLayout.java:172) 09-11 11:18:37.601: E/AndroidRuntime(20395): at greendroid.widget.ActionBar.(ActionBar.java:134) 09-11 11:18:37.601: E/AndroidRuntime(20395): at greendroid.widget.ActionBar.(ActionBar.java:130) 09-11 11:18:37.601: E/AndroidRuntime(20395): ... 26 more

4

0 回答 0