Code example for Fragment

Methods: getActivitygetLoaderManageronActivityCreated

0
    public FenceDetailFragment() { 
        super(); 
    } 
 
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        activity = getActivity();
        contentResolver = activity.getContentResolver();
 
        if (fenceUri != null) {
            getLoaderManager().initLoader(0, null, this);
        } else { 
            // New fence (set default values) 
            Location location = getLastLocationFinder(getActivity()).getLastBestLocation(0, 0);
            if (location != null) {
                nameEditText.setText("fence");
                latitudeEditText.setText(location.getLatitude() + "");
                longitudeEditText.setText(location.getLongitude() + "");
                radiusEditText.setText("500");
                typeRadioGroup.check(typeRadioGroup.getChildAt(0).getId());
Contextual code suggestions in your IDE  Get Codota for Java