I need to add ActionBar.I did steps found from my searches.

1.Added suppoprt library (appcompat v7 support library)

2.Extended to ActionBarActivity

3.Used AppCompat theme in styles.xml and in manifest

But running the project crashes device with error of "**you need to use a Theme.AppCompat theme**"

**styles.xml**

```
<resources>

<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">

</style>

<style name="RatingBar" parent="@android:style/Widget.RatingBar">
    <item name="android:progressDrawable">@drawable/ratingbar</item>
    <item name="android:minHeight">48dip</item>
    <item name="android:maxHeight">48dip</item>
</style>

</resources>

```

**Manifest**

```
<application
    android:icon="@drawable/poweritsolar"
    android:label="@string/app_name" 
    >
    <activity
        android:label="@string/app_name"
        android:name=".Powerit_solarActivity" 
        android:theme="@style/AppBaseTheme">
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".login"></activity>
    <activity android:name=".signup"></activity>
    <activity android:name=".catagory_btns"></activity>
</application>

```

**activity**

```
public class catagory_btns extends ActionBarActivity{

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.catagory_btns);
    Button cat1=(Button)findViewById(R.id.cat1);

    cat1.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            Intent in=new Intent(catagory_btns.this,login.class);
            startActivity(in);
        }
    });

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // TODO Auto-generated method stub
    getMenuInflater().inflate(R.menu.main, menu);
    ActionBar actionBar = getActionBar();
    actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#00ffff")));
    return super.onCreateOptionsMenu(menu);
}

}

```

**LogCat**

```
01-29 05:02:21.211: E/AndroidRuntime(2305): FATAL EXCEPTION: main
01-29 05:02:21.211: E/AndroidRuntime(2305): Process: com.power.it.solar, PID: 2305
01-29 05:02:21.211: E/AndroidRuntime(2305): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.power.it.solar/com.power.it.solar.catagory_btns}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2176)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.app.ActivityThread.access$700(ActivityThread.java:135)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.os.Handler.dispatchMessage(Handler.java:102)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.os.Looper.loop(Looper.java:137)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.app.ActivityThread.main(ActivityThread.java:4998)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at java.lang.reflect.Method.invokeNative(Native Method)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at java.lang.reflect.Method.invoke(Method.java:515)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at dalvik.system.NativeStart.main(Native Method)
01-29 05:02:21.211: E/AndroidRuntime(2305): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:111)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at com.power.it.solar.catagory_btns.onCreate(catagory_btns.java:20)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.app.Activity.performCreate(Activity.java:5243)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
01-29 05:02:21.211: E/AndroidRuntime(2305):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)

```