Out of memory exception in gson.fromJson()

后端 未结 4 807
醉话见心
醉话见心 2021-01-04 21:21

I use the following code for converting Json string(strWebserviceResult) to my Object:

EntMyClass entMyClass = gson.fromJson(strWebserviceResult,EntMyClass.c         


        
4条回答
  •  旧时难觅i
    2021-01-04 21:49

    As with the other post, I would ask whether there is any way to avoid large memory usage with your app. If you can do that, it will be the most optimal solution. If your app really needs that much memory, you can try setting android:largeHeap="true" for your application in the manifest. Here is the reference:

    http://developer.android.com/reference/android/R.styleable.html#AndroidManifestApplication_largeHeap

    See this video for more information:

    http://www.youtube.com/watch?v=_CruQY55HOk

提交回复
热议问题