My app works fine on most devices, except in some, where even in the fragment's onActivityCreated, the getActivity method keeps returning null
. I need Context class to set-up things.
So anyone can help me?
Example
public class BaseProductFragment extends Fragment {
...
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(layout_id, container,
false);
return rootView;
}
public void onActivityCreated(final Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
ImageCacheParams cacheParams = new ImageCacheParams(getActivity(),
Utils.PRODUCTS_CACHE_DIR);
....
}