Code example for File

Methods: exists, fromFile

0
        // than RESULT_OK. So we need to check whether the file we expected 
        // was written to disk in the in the case that we 
        // did not get an intent returned but did get a RESULT_OK. If it was, 
        // we assume that this result has came back from the camera. 
        if (result == null && intent == null && resultCode == Activity.RESULT_OK) {
            File cameraFile = new File(mCameraFilePath);
            if (cameraFile.exists()) {
                result = Uri.fromFile(cameraFile);
                // Broadcast to the media scanner that we have a new photo 
                // so it will be added into the gallery for the user. 
                mController.getActivity().sendBroadcast(
                        new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, result));
            } 
        } 
 
        mUploadMessage.onReceiveValue(result);
        mHandled = true;
        mCaughtActivityNotFoundException = false;
    } 
 
    void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {