0

I am developing an android app in eclipse.I need to use material design.I tried by creating folder values-v21 but app will be crash.Can anyone guide me how to use material design in eclipse?.The style i have added is

<style name="AppTheme" parent="android:Theme.Material">

</style>

</resources>
ramya br
  • 225
  • 2
  • 17

2 Answers2

1
  1. Create a new Android Project with Target SDK version 21
  2. Add Appcompat v7 library to your workspace and add this lib to build path of your project(sdk\extras\android\support\v7)
  3. Then you set Project build target to version 21
  4. There should be only 2 values folder in res folder.

    • values/styles.xml should be as below:
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        // Your style here
</style>
  • values-v21/style.xml should be as below.

<style name="AppBaseTheme"
parent="@android:style/Theme.Material.Light.DarkActionBar">
       ....
      // Your style here
</style>
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
Android
  • 535
  • 5
  • 16
0

For you.. This is Perfect Tutorial. Here step by step explained Troubleshooting Eclipse Issues

First, try simply running Project => Clean... from the top-menu on the project and then re-running the app. If it still doesn't work, it might be the issue explained in the next paragraph.

This happens when the Android project was generated with a minimum SDK of 10 or below. One fix is to simply generate new projects with a minimum SDK of 14 instead. However when generating with a lower minSDK, in order to maintain compatibility with older versions, you'll notice that the activity Java class (i.e src/.../MainActivity.java) extends from AppCompatActivity rather than the standard Activity class. When an activity extends from AppCompatActivity, this requires the app to use a "backwards compatible theme".

Easiest fix is to change the theme for the application within the AndroidManifest.xml such that application:theme is set to @style/Theme.AppCompat.Light.DarkActionBar as shown below:

enter image description here

May This Will Helpful to You.

Note: I just want to give you advise that you can easily Google this thing. Keep Googling First.

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437