I have errors in my class MainActivity.
The error: The method getActivity() is undefined for the type MainActivity
The method getActivity() is undefined for the type MainActivity
publ
This is because you're using getActivity() inside an inner class. Try using:
getActivity()
SherlockFragmentActivity.this.getActivity()
instead, though there's really no need for the getActivity() part. In your case, SherlockFragmentActivity .this should suffice.
SherlockFragmentActivity .this