Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getSherlockActivity() vs getActivity()

I am using SherlockFragment and until today I've always used the getActivity() method to get an instance of the activity hosting the fragment. Now I realiced there's also this method in the SherlockFragment API.. which one should I use?

like image 438
Héctor Júdez Sapena Avatar asked Aug 27 '12 09:08

Héctor Júdez Sapena


1 Answers

Looks like getSherlockActivity is just a shortcut to:

(SherlockActivity) getActivity()
like image 82
Dmitry Zaytsev Avatar answered Sep 30 '22 23:09

Dmitry Zaytsev