daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Sep 24th, 2018 63 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. public void stopRecording() {
  2.     arrowNext.setVisibility(View.INVISIBLE);
  3.     progressNext.setVisibility(View.VISIBLE);
  4.     cdTimer.cancel();
  5.     RecorderStopAsync recorderStopAsync = new RecorderStopAsync();
  6.     recorderStopAsync.execute(mediaRecorder);
  7. }
  8.    
  9. class RecorderStopAsyncTask extends AsyncTask<MediaRecorder, Integer, String> {
  10.  
  11.     @Override
  12.     protected String doInBackground(MediaRecorder... mediaRecorders) {
  13.         if(mediaRecorders.length>0 && mediaRecorders[0]!=null){
  14.             mediaRecorders[0].stop();
  15.             return "Success";
  16.         }
  17.         return null;
  18.     }
  19.  
  20.     @Override
  21.     protected void onPostExecute(String s) {
  22.         if(s!=null){
  23.             onRecordingStoppedSuccessfully();
  24.         }else{
  25.             onRecordingStopFailed();
  26.         }
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top