The process of reproducing the behavior:
Message App --> New Message --> Attach --> Capture Video -->click the Shutter button to start recording video --> click the shutter button to stop recording video --> flashlight is not gray state
The solutions:
private Runnable mVideoSavedRunnable = new Runnable(){ public void run(){ ... setEnableRecordingUI(true); ... }}public void setEnableRecordingUI(boolean enable){ ... mFlashIndicator.setEnable(enable); ...}
As the code ,when Saving the video ,the setEnableRecordingUI() has been invoked.So we should add a judge condition to judge whether the activity is started by others or not. If others(like:Message App) start the video activity,we shouldn't enable the RecordingUI .
Thus ,we can do like these:
private Runnable mVideoSavedRunnable = new Runnable(){ public void run(){ ... if (!mIsVideoCaptureIntent){ setEnableRecordingUI(true); } ... }}