Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java.lang.OutOfMemoryError:执行Android可扩展列表时位图大小超过VM预算_Android - Fatal编程技术网

java.lang.OutOfMemoryError:执行Android可扩展列表时位图大小超过VM预算

java.lang.OutOfMemoryError:执行Android可扩展列表时位图大小超过VM预算,android,Android,根据“我的活动”中的字符串,iam正在执行可扩展列表(我正在从原始文件夹(data.txt)检索所有子内容),但设置适配器时出现了问题 public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String s11="friendly-lovable"; temp=s11.split(delim

根据“我的活动”中的字符串,iam正在执行可扩展列表(我正在从原始文件夹(data.txt)检索所有子内容),但设置适配器时出现了问题

   public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);


              String s11="friendly-lovable";


            temp=s11.split(delimeter);  
            for(i =0; i < temp.length ; i++)
                System.out.println(temp[0]);
            System.out.println(temp[1]);
            System.out.println(temp.length);


                DataGetting();//this method for adding items to expandable List.it is running successfully
            DataGetting1();//calling all values from  raw data.txt file for first word temp[0] .it is also executing successfully 
            childAdding();//calling all values from  raw data.txt file for first word temp[1] .it is also executing successfully 

      elasricadapter=new MyExpandableListAdapter();
      //up to this executing successfully .


      setListAdapter(elasricadapter); //from this line am getting error in log cat .
所以请帮助我任何一个AASP

T&R
Rajinikanth

该阶段正在处理位图。
这张照片简直太大了。没有解决办法,只能使用较小的图像。

这个问题经常出现,并且有答案:
看看:

您还应该尝试直接在真实设备上测试应用程序(使用模拟器提供的所有调试工具),因为可能不会出现内存不足异常。我的一个应用程序就是这样。但是,这并不意味着它永远不会发生。

感谢您的回复。。但是在我的可扩展内存中,我不使用任何图像,只是从原始数据中获取数据,并绑定到子文件。。在堆栈跟踪中,从文件中解码
位图
android.graphics.BitmapFactory.DecodeSourceStream(BitmapFactory.java:326)
。堆栈跟踪还包含对XML第20行的引用。你会用行号发布这个文件的文本版本,或者至少在第20行加上标记吗?
ERROR/dalvikvm-heap(598): 355200-byte external allocation too large for this process.
 ERROR/GraphicsJNI(598): VM won't let us allocate 355200 bytes 
 ERROR/AndroidRuntime(598): FATAL EXCEPTION: main
 ERROR/AndroidRuntime(598): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gini/com.gini.Mainactivity}: android.view.InflateException: Binary XML file line #20: Error inflating class android.widget.ExpandableListView
ERROR/AndroidRuntime(598): Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class android.widget.ExpandableListView
: ERROR/AndroidRuntime(598): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
ERROR/AndroidRuntime(598):     at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
 ERROR/AndroidRuntime(598):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:450)
 ERROR/AndroidRuntime(598):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:326)