小编Bun*_*dee的帖子

Android: WebView's method goBack() shows a blank page

I have an android application that loads web pages in an activity with a WebView. I am using the retrieving the page manually and using WebView's loadDataWithBaseURL to display it on screen. Everything there is fine.

Now, i am trying to override the Back button press to simulate going back in the WebView history stack. I am able to override the Back button press, i can see that there is a history stack in the WebView, i can see that …

android android-webview

11
推荐指数
2
解决办法
6410
查看次数

使用MediaRecorder和FileOutputStream录制视频会生成无法播放的视频文件

我正在尝试实现我可以多次启动和停止视频录制的功能,并将视频数据累积到File.

这就是我准备我的媒体记录器的方法:

private boolean prepareVideoRecorder(){
    mMediaRecorder = new MediaRecorder();

    //0 for landscape
    //90 for portrait

    //Check for available profile
    CamcorderProfile profile = null;
    if(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_480P)){
        Log.d(TAG, "480p");
        profile = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);
    }else if(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_720P)){
        Log.d(TAG, "720p");
        profile = CamcorderProfile.get(CamcorderProfile.QUALITY_720P);
    }else{
        Log.d(TAG, "LOW");
        profile = CamcorderProfile.get(CamcorderProfile.QUALITY_LOW);
    }

    // Step 1: Unlock and set camera to MediaRecorder
    mCamera.unlock();
    mMediaRecorder.setCamera(mCamera);

    // Step 2: Set sources
    mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
    mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);

    // Step 3: Set profile
    mMediaRecorder.setProfile(profile);

    // Step 4: Set output file and pass media recorder the …
Run Code Online (Sandbox Code Playgroud)

android file-descriptor fileoutputstream mediarecorder

7
推荐指数
0
解决办法
1852
查看次数