Android OutOfMemoryException

后端 未结 1 595
旧巷少年郎
旧巷少年郎 2021-02-06 14:01

Is there any way to handle OutOfMemoryException in Android while using Bitmap of large number of pictures. I tried all the solutions given in this site ie(GC, Bitma

相关标签:
1条回答
  • 2021-02-06 14:51

    In your Activity there is a callback function you can implement to be notified of low memory issues:

    http://developer.android.com/reference/android/content/ComponentCallbacks.html#onLowMemory()

    @Override
    public void onLowMemory() {
        super.onLowMemory();
    
        // Your memory releasing code
    }
    
    0 讨论(0)
提交回复
热议问题