我使用CursorLoader
在FragmentActivity
後面的示例代碼here。FragmentActivity,CursorLoader和getActivity undefined
當我嘗試編譯,但是,有關Eclispe給我的錯誤:
The method getActivity is undefined for the class
我怎樣才能解決這個問題?
我使用CursorLoader
在FragmentActivity
後面的示例代碼here。FragmentActivity,CursorLoader和getActivity undefined
當我嘗試編譯,但是,有關Eclispe給我的錯誤:
The method getActivity is undefined for the class
我怎樣才能解決這個問題?
FragmentActivity
沒有任何getActivity()
方法如Fragment
有。如果您想獲得該活動,請在FragmentActivity
內使用this
關鍵字。
爲什麼在這個例子中他們沒有使用FragmentActivity? – Idrone
哪個例子? –
發佈一些代碼,getActivity()是在片段中定義的,你要在哪裏調用它? – idanakav