Content view not yet created

前端 未结 3 1413
小蘑菇
小蘑菇 2021-02-07 14:51

I am trying to retrieve the data from mysql and sort it based on the category tab. My application crash when i open the activity with content view not yet created. May I know wh

3条回答
  •  青春惊慌失措
    2021-02-07 14:58

    You can't call getListView() in the onCreateView() because the ListView doesn't exist yet. You need to put that code inside onViewCreated().

提交回复
热议问题