I have an app that uses fragments.I'm using backward compability package with Android 开发者_开发知识库2.2. I can inflate xml just fine, but problem starts when I try to access objects on the inflated layout. LogCat throws "Error inflating class fragment". What I'm doing wrong ? Here is my code :
View view001 = inflater.inflate(R.layout.bottom_right_view,container,false);
TextView text001= (TextView)getActivity().findViewById(R.id.textView1);
text001.setText("Sample text");
View view001 = inflater.inflate(R.layout.bottom_right_view,container,false);
TextView text001= (TextView)view001.findViewById(R.id.textView1);
text001.setText("Sample text");
精彩评论