Android 强制关闭位图超过32位

Android 强制关闭位图超过32位,android,bitmap,Android,Bitmap,首先,我为mini 2制作了一个应用程序,运行得非常完美,但当我尝试运行时,我想知道为什么我得到了屏幕的一半,我得到的宽度值是420 WindowManager wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE); // the results will be higher than using the activity context object or the getWin

首先,我为mini 2制作了一个应用程序,运行得非常完美,但当我尝试运行时,我想知道为什么我得到了屏幕的一半,我得到的宽度值是420

WindowManager wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE); // the results will be higher than using the activity context object or the getWindowManager() shortcut
      wm.getDefaultDisplay().getMetrics(displayMetrics);
wm.getDefaultDisplay().getMetrics(displayMetrics);
          lebar = displayMetrics.widthPixels; 
当我尝试使用
lebar=(int)displayMetrics.widthPixels*displayMetrics.densityDpi

我的力量接近了

07-17 22:28:26.994: E/AndroidRuntime(3936): FATAL EXCEPTION: main
07-17 22:28:26.994: E/AndroidRuntime(3936): java.lang.IllegalArgumentException: bitmap size exceeds 32bits
07-17 22:28:26.994: E/AndroidRuntime(3936):     at android.graphics.Bitmap.nativeCreate(Native Method)
07-17 22:28:26.994: E/AndroidRuntime(3936):     at android.graphics.Bitmap.createBitmap(Bitmap.java:691)
07-17 22:28:26.994: E/AndroidRuntime(3936):     at android.graphics.Bitmap.createBitmap(Bitmap.java:668)
07-17 22:28:26.994: E/AndroidRuntime(3936):     at android.graphics.Bitmap.createBitmap(Bitmap.java:601)
07-17 22:28:26.994: E/AndroidRuntime(3936):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:481)
07-17 22:28:26.994: E/AndroidRuntime(3936):     at skripsi.slidame.slidameBoard.<init>(slidameBoard.java:84)
second.java

public static slidameBoard createGameBoard(Context context, 
                                 Bitmap bitmap, 
                                 TableLayout parentLayout,
                                 int width,
                                 int height,
                                 int gridSize) {

      board = new slidameBoard(context, 
                       bitmap, 
                       parentLayout, 
                       width, 
                       height, 
                       gridSize);

      return board;
   }

导致崩溃的代码在哪里?对
createScaledBitmap()
等的调用最终完成。。。案例结束时,im使用的是
密度
而不是
密度dpi
:)
public static slidameBoard createGameBoard(Context context, 
                                 Bitmap bitmap, 
                                 TableLayout parentLayout,
                                 int width,
                                 int height,
                                 int gridSize) {

      board = new slidameBoard(context, 
                       bitmap, 
                       parentLayout, 
                       width, 
                       height, 
                       gridSize);

      return board;
   }