public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
//LayoutInflater作用是将layout的xml布局文件实例化为View类对象
Log.i("Test","------------->>>>>> " + (convertView == null));
if(convertView == null || !(convertView instanceof LinearLayout)){
convertView = (LinearLayout) LayoutInflater.from(mContext)
.inflate(R.layout.groupitem, null);
}
Log.i("Test", "i am be loaded ----------> groupPosition = " + groupPosition);
ImageView image = (ImageView) convertView.findViewById(R.id.group_image);
TextView name = (TextView) convertView.findViewById(R.id.group_name);
TextView id = (TextView) convertView.findViewById(R.id.group_id);
TextView currProgram = (TextView) convertView.findViewById(R.id.group_program);
name.setText(group.get(groupPosition).toString());
id.setText(String.valueOf(groupPosition));
currProgram.setText(child.get(groupPosition).get(0).get("name"));
LinearLayout linear = (LinearLayout) convertView.findViewById(R.id.linearLayout1);
//切换到下拉列表
if (isExpanded) {
image.setImageResource(R.drawable.list_arrow1);
linear.setLayoutParams(new LinearLayout.LayoutParams(621,95));
//linear.setLayoutParams(new LinearLayout.LayoutParams(640,115));
//linear.setBackgroundResource(android.R.color.transparent);
} else {
image.setImageResource(R.drawable.list_arrow0);
linear.setLayoutParams(new LinearLayout.LayoutParams(600,87));
//linear.setBackgroundResource(R.drawable.selector_0);
}
return convertView;
}
以下是错误的打印。
11-08 13:44:11.969: I/Test(510): ------------->>>>>> true
11-08 13:44:11.989: E/dalvikvm-heap(510): 533104-byte external allocation too large for this process.
11-08 13:44:11.989: E/GraphicsJNI(510): VM won't let us allocate 533104 bytes
11-08 13:44:12.009: D/AndroidRuntime(510): Shutting down VM
11-08 13:44:12.009: W/dalvikvm(510): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
11-08 13:44:12.069: E/AndroidRuntime(510): FATAL EXCEPTION: main
11-08 13:44:12.069: E/AndroidRuntime(510): android.view.InflateException: Binary XML file line #20: Error inflating class <unknown>
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
11-08 13:44:12.069: E/AndroidRuntime(510): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
11-08 13:44:12.069: E/AndroidRuntime(510): at com.ipanel.join.cqmobile.view.MyExpandableAdapter.getGroupView(MyExpandableAdapter.java:120)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.ExpandableListConnector.getView(ExpandableListConnector.java:445)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.AbsListView.obtainView(AbsListView.java:1315)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.ListView.makeAndAddView(ListView.java:1727)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.ListView.fillDown(ListView.java:652)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.ListView.fillFromTop(ListView.java:709)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.ListView.layoutChildren(ListView.java:1580)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.AbsListView.onLayout(AbsListView.java:1147)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.View.layout(View.java:7035)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:909)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.View.layout(View.java:7035)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.View.layout(View.java:7035)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.View.layout(View.java:7035)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.View.layout(View.java:7035)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1388)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.View.layout(View.java:7035)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:909)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.View.layout(View.java:7035)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1238)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.LinearLayout.onLayout(LinearLayout.java:1044)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.View.layout(View.java:7035)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.View.layout(View.java:7035)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.View.layout(View.java:7035)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.View.layout(View.java:7035)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.ViewRoot.performTraversals(ViewRoot.java:1045)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.os.Handler.dispatchMessage(Handler.java:99)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.os.Looper.loop(Looper.java:123)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-08 13:44:12.069: E/AndroidRuntime(510): at java.lang.reflect.Method.invokeNative(Native Method)
11-08 13:44:12.069: E/AndroidRuntime(510): at java.lang.reflect.Method.invoke(Method.java:521)
11-08 13:44:12.069: E/AndroidRuntime(510): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-08 13:44:12.069: E/AndroidRuntime(510): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-08 13:44:12.069: E/AndroidRuntime(510): at dalvik.system.NativeStart.main(Native Method)
11-08 13:44:12.069: E/AndroidRuntime(510): Caused by: java.lang.reflect.InvocationTargetException
11-08 13:44:12.069: E/AndroidRuntime(510): at android.widget.LinearLayout.<init>(LinearLayout.java:115)
11-08 13:44:12.069: E/AndroidRuntime(510): at java.lang.reflect.Constructor.constructNative(Native Method)
11-08 13:44:12.069: E/AndroidRuntime(510): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
11-08 13:44:12.069: E/AndroidRuntime(510): ... 49 more
11-08 13:44:12.069: E/AndroidRuntime(510): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
11-08 13:44:12.069: E/AndroidRuntime(510): at android.graphics.Bitmap.nativeCreate(Native Method)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.graphics.Bitmap.createBitmap(Bitmap.java:468)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.graphics.Bitmap.createBitmap(Bitmap.java:435)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)
11-08 13:44:12.069: E/AndroidRuntime(510): at android.grap
11-08 13:44:24.509: I/Process(510): Sending signal. PID: 510 SIG: 9
唉,真不知道问题何在,求各位大神不吝赐教。感激不尽啊。。。。