Skip to content Skip to sidebar Skip to footer

How To Remove Error : Create Method 'getapplicationcontext()' And 'runonuithread(runnable)' When Extends Fragment

When I am using the getApplicationContext() that time eclipse give me error create method 'getApplicationContext()'. Please let me know How to remove this error. I am try also usin

Solution 1:

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().

Post a Comment for "How To Remove Error : Create Method 'getapplicationcontext()' And 'runonuithread(runnable)' When Extends Fragment"