Code example for Fragment

Methods: onActivityResult

0
        getActivity().runOnUiThread(runnable);
    } 
 
    @Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
 
        if (resultCode == Activity.RESULT_OK) {
 
            Uri mediaLocation = null;
            if (data != null) {
                mediaLocation = data.getData();
                new UpdateMedia().execute(mediaLocation);
            } 
        } 
    } 
 
    public class UpdateMedia extends AsyncTask<Uri, Object, File> {
 
        ProgressDialog dialog;
Stop searching for code, let great code find you!  Add Codota to your java IDE