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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Looks like getSherlockActivity
is just a shortcut to:
(SherlockActivity) getActivity()