Archie.bpgc
Archie.bpgc

Reputation: 24012

class not found exception in using actionbar sherlock

I downloaded actionbar sherlock library from the main site itself. and i tried to use it in my app.

import com.actionbarsherlock.app.SherlockActivity;
import android.os.Bundle;

public class Sherlockactivity extends SherlockActivity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

}

but when i started the app with the default main.xml layout, i get this exception.

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.android.sherlock/com.android.sherlock.SherlockActivity}: java.lang.ClassNotFoundException: com.android.sherlock.SherlockActivity in loader dalvik.system.PathClassLoader[/data/app/com.android.sherlock-1.apk]

my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.sherlock"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="14" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/Theme.Sherlock" >
        <activity
            android:name=".SherlockActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

i just started to use support libraries. have no idea how to solve this.

Thank you

Upvotes: 2

Views: 2178

Answers (1)

Yahor10
Yahor10

Reputation: 2132

  • Download sherlock action bar zip.
  • New->android project from existed source
  • choose library folder from sherlock bar folder
  • in the properties of your project, ->android->add library and set the folder that you copy.

See Using an ActionBar in your Android app with ActionBarSherlock.

Upvotes: 7

Related Questions