Tôi có đoạn code sau để xem một file video lưu trữ từ xa:Intent.ACTION_VIEW URL video không làm việc trên Ice Cream Sandwhich
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(article.getLink())));
nơi getLink()
trả về URL của video liên quan đến bài viết.
Cách tiếp cận này đã hoạt động tốt trên các thiết bị lên Gingerbread, nhưng gần đây tôi đã thử nghiệm ứng dụng trên ICS và đã phát hiện sự cố. Trình duyệt ICS bắt đầu tải URL và tôi thấy nó trong thanh điều hướng, nhưng sau đó gần như ngay lập tức trình duyệt đóng và tôi được đưa trở lại hoạt động của ứng dụng.
Tôi nhận được vết đống sau khi nó xảy ra:
11-28 10:24:44.488: E/SurfaceTexture(116): [com.mypackage.myapp/com.mypackage.myapp.MyVideoActivity] connect: already connected (cur=2, req=2)
11-28 10:24:44.488: E/ViewRootImpl(25384): IllegalArgumentException locking surface
11-28 10:24:44.488: E/ViewRootImpl(25384): java.lang.IllegalArgumentException
11-28 10:24:44.488: E/ViewRootImpl(25384): at android.view.Surface.lockCanvasNative(Native Method)
11-28 10:24:44.488: E/ViewRootImpl(25384): at android.view.Surface.lockCanvas(Surface.java:76)
11-28 10:24:44.488: E/ViewRootImpl(25384): at android.view.ViewRootImpl.draw(ViewRootImpl.java:1924)
11-28 10:24:44.488: E/ViewRootImpl(25384): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1613)
11-28 10:24:44.488: E/ViewRootImpl(25384): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2418)
11-28 10:24:44.488: E/ViewRootImpl(25384): at android.os.Handler.dispatchMessage(Handler.java:99)
11-28 10:24:44.488: E/ViewRootImpl(25384): at android.os.Looper.loop(Looper.java:137)
11-28 10:24:44.488: E/ViewRootImpl(25384): at android.app.ActivityThread.main(ActivityThread.java:4340)
11-28 10:24:44.488: E/ViewRootImpl(25384): at java.lang.reflect.Method.invokeNative(Native Method)
11-28 10:24:44.488: E/ViewRootImpl(25384): at java.lang.reflect.Method.invoke(Method.java:511)
11-28 10:24:44.488: E/ViewRootImpl(25384): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-28 10:24:44.488: E/ViewRootImpl(25384): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-28 10:24:44.488: E/ViewRootImpl(25384): at dalvik.system.NativeStart.main(Native Method)
Có ai khác nhìn thấy hành vi này/bí quyết của một sửa chữa?
Điều này không hoạt động trên Samsung Galaxy Tab 2 đang chạy ICS. :( –