BlackjackGTV示例 - OutOfMemory

时间:2013-04-02 20:36:43

标签: android google-tv

我试图在Vizio Co-Star(谷歌电视)上播放Blackjack Google TV样本。我从https://code.google.com/p/googletv-android-samples/下载了示例代码,但是当我将其部署到Vizio时,我收到了OutOfMemory错误。

有没有人让Blackjack GTV样本有效?

完整堆栈跟踪:

04-02 13:32:56.364:E / dalvikvm-heap(4027):78655376字节分配时内存不足。 04-02 13:32:56.374:E / AndroidRuntime(4027):致命异常:主要 04-02 13:32:56.374:E / AndroidRuntime(4027):java.lang.RuntimeException:无法启动活动ComponentInfo {com.google.android.tv.blackjack / com.google.android.tv.blackjack.BlackJackTableActivity} :android.view.InflateException:二进制XML文件行#17:错误类膨胀 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1836) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1852) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.app.ActivityThread.access $ 500(ActivityThread.java:124) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1038) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.os.Handler.dispatchMessage(Handler.java:99) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.os.Looper.loop(Looper.java:132) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.app.ActivityThread.main(ActivityThread.java:4196) 04-02 13:32:56.374:E / AndroidRuntime(4027):at java.lang.reflect.Method.invokeNative(Native Method) 04-02 13:32:56.374:E / AndroidRuntime(4027):at java.lang.reflect.Method.invoke(Method.java:491) 04-02 13:32:56.374:E / AndroidRuntime(4027):at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:841) 04-02 13:32:56.374:E / AndroidRuntime(4027):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599) 04-02 13:32:56.374:E / AndroidRuntime(4027):at dalvik.system.NativeStart.main(Native Method) 04-02 13:32:56.374:E / AndroidRuntime(4027):引起:android.view.InflateException:二进制XML文件行#17:错误膨胀类 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.view.LayoutInflater.createView(LayoutInflater.java:596) 04-02 13:32:56.374:E / AndroidRuntime(4027):at com.android.internal.policy.impl.tv.TvLayoutInflater.onCreateView(TvLayoutInflater.java:50) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.view.LayoutInflater.onCreateView(LayoutInflater.java:644) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.view.LayoutInflater.inflate(LayoutInflater.java:457) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.view.LayoutInflater.inflate(LayoutInflater.java:391) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.view.LayoutInflater.inflate(LayoutInflater.java:347) 04-02 13:32:56.374:E / AndroidRuntime(4027):at com.android.internal.policy.impl.tv.TvWindow.setContentView(TvWindow.java:248) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.app.Activity.setContentView(Activity.java:1809) 04-02 13:32:56.374:E / AndroidRuntime(4027):at com.google.android.tv.blackjack.BlackJackTableActivity.onCreate(BlackJackTableActivity.java:58) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.app.Activity.performCreate(Activity.java:4438) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1800) 04-02 13:32:56.374:E / AndroidRuntime(4027):... 11更多 04-02 13:32:56.374:E / AndroidRuntime(4027):引起:java.lang.reflect.InvocationTargetException 04-02 13:32:56.374:E / AndroidRuntime(4027):at java.lang.reflect.Constructor.constructNative(Native Method) 04-02 13:32:56.374:E / AndroidRuntime(4027):at java.lang.reflect.Constructor.newInstance(Constructor.java:416) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.view.LayoutInflater.createView(LayoutInflater.java:576) 04-02 13:32:56.374:E / AndroidRuntime(4027):......还有23个 04-02 13:32:56.374:E / AndroidRuntime(4027):引起:java.lang.OutOfMemoryError 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.graphics.Bitmap.nativeCreate(Native Method) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.graphics.Bitmap.createBitmap(Bitmap.java:604) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.graphics.Bitmap.createBitmap(Bitmap.java:551) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:738) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.content.res.Resources.loadDrawable(Resources.java:1918) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.content.res.TypedArray.getDrawable(TypedArray.java:601) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.view.View。(View.java:2477) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.view.ViewGroup。(ViewGroup.java:379) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.widget.FrameLayout。(FrameLayout.java:94) 04-02 13:32:56.374:E / AndroidRuntime(4027):在android.widget.FrameLayout。(FrameLayout.java:90) 04-02 13:32:56.374:E / AndroidRuntime(4027):... 26更多

1 个答案:

答案 0 :(得分:0)

如果您打开布局文件并从源中删除android:background =“@ drawable / green_background”,那么它将适合您。最近有一个内存分区更改,并且样本尚未更新以减少其内存占用(例如,大位图图像)