Search code examples
androidactionbarsherlockpull-to-refresh

ActionBarSherlock 4 - extend from another class?


I am trying to use:

https://github.com/johannilsson/android-pulltorefresh

with ActionBarSherlock 4 and I got stuck on the part where my MainActivity class extends SherlockActivity while the Pull-to-Refresh library extends ListActivity..

Anyone know what can I do?

I also saw another old post: Usage of both EasyTracker and ActionBarSherlock on Android

That Jake says there that "you can create your own base activities that extend from whatever class you want"

How can I do that on my ListActivity?

Thanks in advanced, Din...


Solution

  • ActionBarSherlock also contains a SherlockListActivity class, which provides the same functionality as ListActivity. One caveat is that SherlockListActivity does not extend FragmentActivity, so you will be unable to use Fragments in that Activity as explained in this question.

    If you'd like to use Fragments, ActionBarSherlock, and one of the helper classes to use ListViews, I would suggest using SherlockActivity and a Fragment that extends SherlockListFragment.