基于活动中的字符串,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 .错误是:
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)所以请帮助我
拉吉尼卡
发布于 2011-07-27 13:01:35
您还应该尝试直接在实际设备上测试应用程序(使用模拟器提供的所有调试工具),因为内存不足异常可能不会出现。我的一个应用程序就是这样。但是,这并不意味着它永远不会发生。
发布于 2011-07-27 12:49:47
该阶段正在处理位图。这张照片实在太大了。除了使用较小的图像之外,没有其他解决办法。
发布于 2011-07-27 12:51:31
https://stackoverflow.com/questions/6844517
复制相似问题