@ Override public void onActivityResult ( int requestCode , int resultCode , Intent data ) { super . onActivityResult ( requestCode , resultCode , data ) ; //verify if the image was gotten successfully if ( requestCode == REQUEST_TAKE_CAMERA_PHOTO && resultCode == Activity . RESULT_OK ) { new ImageCompressionAsyncTask ( this ) . execute ( mCurrentPhotoPath , Environment . getExternalStoragePublicDirectory ( Environment . DIRECTORY_PICTURES ) + "/Silicompressor/images" ) ; } else if ( requestCode == REQUEST_TAKE_VIDEO && resultCode == RESULT_OK ) { if ( data . getData ( ) != null ) { //create destination directory File f = new File ( Environment . getExternalStoragePublicDirectory ( Environment . DIRECTORY_MOVIES ) + "/Silicompressor/videos" ) ; if ( f . mkdirs ( ) || f . isDirectory ( ) ) //compress and output new video specs new VideoCompressAsyncTask ( this ) . execute ( mCurrentPhotoPath , f . getPath ( ) ) ; } } }
Method which will process the captured image