Create take Sound Recorder Intent - Android Intent

Android examples for Intent:Take Sound

Description

Create take Sound Recorder Intent

Demo Code


import android.app.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.provider.MediaStore;

public class Main{
    //  ww w. j  a va2s  .co m
    public static final int RESULT_CAPTURE_RECORDER_SOUND = REQUEST_CODE_TAKE_PHOTO + 2;
    
    public static void takeSoundRecorder(Activity activity) {
        Intent intent = takeSoundRecorderIntent();
        activity.startActivityForResult(intent,
                RESULT_CAPTURE_RECORDER_SOUND);
    }
    private static Intent takeSoundRecorderIntent() {
        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
        intent.setType("audio/amr");
        return intent;
    }
}

Related Tutorials