我發現這個link,我想試試旋轉木馬示例。我把所有的類和rs文件(所有來自輪播示例的文件)複製到我自己的項目中,然後嘗試在實際設備上構建它(Motorola xoom)。但是我不斷收到武力。在logcat中的錯誤是:Android Renderscript示例強制關閉
11-01 11:37:23.490: E/RenderScript(927): 0x17c718, couldn't find an EGLConfig matching
the screen format
11-01 12:09:53.320: E/AndroidRuntime(1214): FATAL EXCEPTION: main
11-01 12:09:53.320: E/AndroidRuntime(1214): java.lang.RuntimeException: Unable to
start activity ComponentInfo{com.android.example/com.android.example.CarouselActivity}:
java.lang.NullPointerException
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1748)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1764)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.app.ActivityThread.access$1500(ActivityThread.java:122)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1002)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.os.Looper.loop(Looper.java:132)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.app.ActivityThread.main(ActivityThread.java:4025)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
java.lang.reflect.Method.invokeNative(Native Method)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
java.lang.reflect.Method.invoke(Method.java:491)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
dalvik.system.NativeStart.main(Native Method)
11-01 12:09:53.320: E/AndroidRuntime(1214): Caused by: java.lang.NullPointerException
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.renderscript.Allocation.elementFromBitmap(Allocation.java:821)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.renderscript.Allocation.typeFromBitmap(Allocation.java:839)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.renderscript.Allocation.createFromBitmap(Allocation.java:864)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.renderscript.Allocation.createFromBitmapResource(Allocation.java:1074)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
com.android.example.CarouselRS.loadImages(CarouselRS.java:127)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
com.android.example.CarouselRS.initRS(CarouselRS.java:188)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
com.android.example.CarouselRS.init(CarouselRS.java:36)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
com.android.example.CarouselView.ensureRenderScript(CarouselView.java:25)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
com.android.example.CarouselView.<init>(CarouselView.java:13)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
com.android.example.CarouselActivity.onCreate(CarouselActivity.java:15)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
11-01 12:09:53.320: E/AndroidRuntime(1214): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1712)
11-01 12:09:53.320: E/AndroidRuntime(1214): ... 11 more
我不知道這是什麼意思,我應該如何解決這個問題。有沒有人有這種問題?
在GoogleTV模擬器上獲取相同的錯誤。 –