Code example for View

Methods: findViewByIdsetTag

0
            public View getView(int position, View convertView, ViewGroup parent) {
                if (convertView == null) {
                    LayoutInflater li = LayoutInflater.from(MainActivity.this);
                    convertView = li.inflate(android.R.layout.simple_list_item_1, parent, false);
                } 
                TextView tv = (TextView)convertView.findViewById(android.R.id.text1);
                Class<?> cls = TESTS[position];
                tv.setText(cls.getSimpleName());
                convertView.setTag(cls);
                return convertView;
            } 
 
            @Override 
            public long getItemId(int position) {
                return position;
            } 
 
            @Override 
            public Object getItem(int position) {
                return TESTS[position];
Experience pair programming with AI  Get Codota for Java