0

I am trying to use the code generated from Android Action Bar Style Generator.for creating and tabs in my application.but Unfortunately stopped error is being shown..Maybe some issue of theme..I have also added: android:theme="@style/Theme.Example" in manifest.

Please help me. I am a beginner in android.

LogCat:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.priyankagupta.tabbing/com.example.priyankagupta.tabbing.MainActivity}: 
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2338)
priyanka
  • 171
  • 2
  • 12
  • It won't work like this. Show the XML containing Tab. – Tushar Gogna Apr 15 '15 at 05:08
  • possible duplicate of [How to change color of Selected Tab](http://stackoverflow.com/questions/18909273/how-to-change-color-of-selected-tab) – Tushar Gogna Apr 15 '15 at 05:09
  • Thanks....I got something..will try..hope will be helpful to me – priyanka Apr 15 '15 at 08:13
  • In your manifest, you're using different theme. Use **AppTheme** there. – Tushar Gogna Apr 15 '15 at 10:11
  • yes..this was the issue..Thanks a lot.......... – priyanka Apr 15 '15 at 10:15
  • Glad to help. In future, try to explain your question by giving as much details as possible (related code, error logs, etc) in order to get quick answers. :) – Tushar Gogna Apr 15 '15 at 10:17
  • It's hard to tell why it's not showing up without looking at the code. Can you show your `Styles.xml` & `Manifest.xml`? – Tushar Gogna Apr 15 '15 at 10:23
  • I can explain but commenting under the question is getting too long & your reputation is too low to chat [here](http://chat.stackoverflow.com/rooms/71661/android-discussions). You can do one thing, if it's just a demo application then you can mail it to me as a .rar/.zip and I'll check it for you. – Tushar Gogna Apr 15 '15 at 10:40
  • actually in Mainactivity class it was hidden somehow... – priyanka Apr 15 '15 at 11:24

1 Answers1

0

Remove the android tag like:

<item name="actionBarTabTextStyle">@style/MyTheme.ActionBar.TabText</item>

because you are using support library.

And also try to use parent of MyTheme.ActionBar.TabText as:

parent="Widget.AppCompat.Base.ActionBar.TabText"
Xcihnegn
  • 11,579
  • 10
  • 33
  • 33