iknow4x / Android-Video-Trimmer

The Android-Video-Trimmer project implements the selection of clips for long and short videos. It uses MediaMetadataRetriever to obtain video frames, and uses ffmpeg for video cropping and video compression.
Apache License 2.0
1.1k stars 264 forks source link

点击完成闪退 #6

Closed JsonWong87 closed 6 years ago

JsonWong87 commented 6 years ago

FATAL EXCEPTION: main Process: com.iknow.android, PID: 6953 java.lang.RuntimeException: Only one Looper may be created per thread at android.os.Looper.prepare(Looper.java:88) at android.os.Looper.prepare(Looper.java:83) at com.iknow.android.TrimmerActivity.onFinishTrim(TrimmerActivity.java:79) at com.iknow.android.utils.TrimVideoUtil$1.onSuccess(TrimVideoUtil.java:61) at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.onPostExecute(FFmpegExecuteAsyncTask.java:68) at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.onPostExecute(FFmpegExecuteAsyncTask.java:10) at android.os.AsyncTask.finish(AsyncTask.java:651) at android.os.AsyncTask.-wrap1(AsyncTask.java) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

JsonWong87 commented 6 years ago

if (Looper.myLooper()==null) Looper.prepare();

这样就行了