while(true){ // do something }
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.image); imageView.setImageBitmap(bitmap);
android { // ... dexOptions { javaMaxHeapSize "4g" } }
这将将堆内存限制增加到4 GB。
参考文献:https://stackoverflow.com/questions/61046412/android-studio-app-crashes-after-calling-multiple-commands