title: ClasscastException android.support.v7.widget.ShareActionProvider to action.view.ActionProvider
body: <p>Below is my Activity Code. </p>
  
  <p>The problem is that i am not able to use AppCompat library properly and its giving me </p>
  
  <p><code>ClasscastException android.support.v7.widget.ShareActionProvider to action.View.ActionProvider</code></p>
  
  <pre><code>   import android.content.Intent;
     import android.os.Bundle;
     import android.support.v4.view.MenuItemCompat;
     import android.support.v7.app.ActionBarActivity;
     import android.support.v7.widget.ShareActionProvider;
     import android.view.Menu;
     import android.view.MenuItem;
  
      public class MainActivity extends ActionBarActivity{
  android.support.v7.widget.ShareActionProvider shareAction;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.activity_main, menu);
      MenuItem item =(MenuItem) menu.findItem(R.id.menu_settings);
      shareAction = (ShareActionProvider) MenuItemCompat
              .getActionProvider(item);
      shareAction.setShareIntent(createShareIntent());
      return true;
  }
  
  public Intent createShareIntent() {
      Intent share = new Intent(Intent.ACTION_SEND);
      share.setAction(Intent.ACTION_SEND).putExtra(Intent.EXTRA_TEXT, "TEST")
              .setType("text/plain");
      return share;
  }
  
  }
  </code></pre>
  
  <p>According the Guide at developer.android.com i am using the library correctly</p>
  
  <p>Below is my menu file</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" 
  xmlns:easyshare="http://schemas.android.com/apk/res-auto"&gt;
  
  &lt;item
      android:id="@+id/menu_settings"
      android:orderInCategory="100"
      easyshare:showAsAction="ifRoom"
      easyshare:actionProviderClass="android.support.v7.widget.ShareActionProvider"
      /&gt;
    &lt;/menu&gt;
  </code></pre>
  
  <p>** Edited LogCat output ** Sorry earlier i was getting the exception as given in label but seeing now i am getting this error and somehow not able to find the problem</p>
  
  <pre><code>    10-02 02:17:46.566: E/AndroidRuntime(896): FATAL EXCEPTION: main
      10-02 02:17:46.566: E/AndroidRuntime(896): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
      10-02 02:17:46.566: E/AndroidRuntime(896):  at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:98)
      10-02 02:17:46.566: E/AndroidRuntime(896):  at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
      10-02 02:17:46.566: E/AndroidRuntime(896):  at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
      10-02 02 :17:46.566: E/AndroidRuntime(896):     at net.mobitexter.easyshare.MainActivity.onCreate(MainActivity.java:16)
      10-02 02:17:46.566: E/AndroidRuntime(896):  at android.app.Activity.performCreate(Activity.java:4465)
      10-02 02:17:46.566: E/AndroidRuntime(896):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
      10-02 02:17:46.566: E/AndroidRuntime(896):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
      10-02 02:17:46.566: E/AndroidRuntime(896):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
      10-02 02:17:46.566: E/AndroidRuntime(896):  at android.app.ActivityThread.access$600(ActivityThread.java:127)
       10-02 02:17:46.566: E/AndroidRuntime(896):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
       10-02 02:17:46.566: E/AndroidRuntime(896):     at android.os.Handler.dispatchMessage(Handler.java:99)
       10-02 02:17:46.566: E/AndroidRuntime(896):     at android.os.Looper.loop(Looper.java:137)
       10-02 02:17:46.566: E/AndroidRuntime(896):     at android.app.ActivityThread.main(ActivityThread.java:4448)
       10-02 02:17:46.566: E/AndroidRuntime(896):     at java.lang.reflect.Method.invokeNative(Native Method)
       10-02 02:17:46.566: E/AndroidRuntime(896):     at java.lang.reflect.Method.invoke(Method.java:511)
       10-02 02:17:46.566: E/AndroidRuntime(896):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)
       10-02 02:17:46.566: E/AndroidRuntime(896):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
       10-02 02:17:46.566: E/AndroidRuntime(896):     at dalvik.system.NativeStart.main(Native Method)
       10-02 02:18:02.152: I/Process(896): Sending signal. PID: 896 SIG: 9
  </code></pre>
  
  <p>*<em>See if the manifest helps *</em>
  The below is the code of my manifest file</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="net.mobitexter.easyshare"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="9"
      android:targetSdkVersion="17" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="net.mobitexter.easyshare.MainActivity"
          android:label="@string/app_name"
           &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>