How to remove error : create method 'getApplicationContext()' and 'runOnUiThread(Runnable)' when extends Fragment

后端 未结 1 600
遇见更好的自我
遇见更好的自我 2021-01-15 04:59

When I am using the getApplicationContext() that time eclipse give me error create method \'getApplicationContext()\'. Please let me know How to re

相关标签:
1条回答
  • 2021-01-15 05:02

    In a Fragment, you can use getActivity().getApplicationContext() instead.

    As for the AppSettings.getMeasureUnit error, if the getMeasureUnit method is expecting a context you can usually use getActivity().getApplicationContext().

    0 讨论(0)
提交回复
热议问题