ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
int memorySize = activityManager.getMemoryClass();

测试结果:
华为mate7:192m
小米4:128m
红米:128m
三星SM-N7508v:96m

Android4.0以后,可以通过在application节点中设置属性Android:largeHeap=”true”来突破这个上限。

相关文章:

  • 2022-12-23
  • 2021-09-16
  • 2021-07-06
  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2021-06-10
猜你喜欢
  • 2021-07-28
  • 2021-11-07
  • 2021-08-16
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
相关资源
相似解决方案