ANDROID: How to access fragment layout objects?

I have an application that uses fragments. I am using backward compatibility package with Android 2.2. I can inflate xml just fine, but the problem starts when I try to access objects on a bloated layout. LogCat throws a "Class bloat error". What am I 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"); 
+4
source share
1 answer
 View view001 = inflater.inflate(R.layout.bottom_right_view,container,false); TextView text001= (TextView)view001.findViewById(R.id.textView1); text001.setText("Sample text"); 
+5
source

Source: https://habr.com/ru/post/1346711/


All Articles