Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 SherlockFragment,直到今天我一直使用 getActivity() 方法来获取托管片段的活动实例。现在我意识到 SherlockFragment API 中也有这个方法。我应该使用哪一个?
看起来getSherlockActivity只是一个捷径:
getSherlockActivity
(SherlockActivity) getActivity()