d3m0li5h3r
d3m0li5h3r

Reputation: 1967

SherlockFragmentActivity causing ClassNotFoundException

I'm having a class that extends SherlockFragmentActivity

When trying to run the program am getting ClassNotFoundException

I've tried this solution but to no avail.

I would also like to mention that I'm setting this class as my launcher activity in the manifest. Also when I change the SherlockFragmentAcivity to SherlockActivity I'm able to run the program but can't use fragments anymore as there's no getSupportFragmentManager() method in SherlockActivity class.

Upvotes: 5

Views: 2009

Answers (4)

Ruslan Mansurov
Ruslan Mansurov

Reputation: 1301

I had the same problem. The wrong thing that I did is adding actionbarsherlock project to Project properties -> Java build path -> Projects. Instead I had to add actionbarsherlock to Project properties -> Android -> Library

I found solution here: https://stackoverflow.com/a/16736937/1820856

Upvotes: 0

d3m0li5h3r
d3m0li5h3r

Reputation: 1967

I found the solution. Deleting the support library from libs folder did the trick for me.

Upvotes: 3

nikhil.thakkar
nikhil.thakkar

Reputation: 1093

If you are SherlockActivity then the method to get the fragment manager is getFragmentManager().

Upvotes: -1

Blackbelt
Blackbelt

Reputation: 157487

If you have the latest adt version (22) you need to check Android Private Libraries. In eclipse:

  • Rigth click on project and select properties
  • Click on Java Build Path
  • Click on order & export tab and tick on Android Private Libraries

Upvotes: 2

Related Questions