public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
View v = null;
if( convertView != null )
v = convertView;
else
v = inflater.inflate(R.layout.child_row, parent, false);
Color c = (Color)getChild( groupPosition, childPosition );
TextView color = (TextView)v.findViewById( R.id.childname );
if( color != null )
color.setText( c.getColor() );
TextView rgb = (TextView)v.findViewById( R.id.rgb );
if( rgb != null )
rgb.setText( c.getRgb() );
// CheckBox cb = (CheckBox)v.findViewById( R.id.check1 );
// cb.setChecked( c.getState() );
Button btnPlay=(Button)v.findViewById(R.id.Play);
Button btnDelete=(Button)v.findViewById(R.id.Delete);
Button btnEmail=(Button)v.findViewById(R.id.Email);
btnPlay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Log.i("TEST ", "play btn cliked");
Intent i=new Intent(this,FindFilesByType.class);//THIS IS NOT ALLOWED IN MY CODE
}
});
return v;
}
В коде выше я написал свой класс адаптера.
В моем детском списке есть 3 кнопки.
Я хочу вызвать другой класс Java по событию нажатия кнопки,
Итак, когда я использую:
Intent i=new Intent(this,FindFilesByType.class);
Я получаю это:
The constructor Intent(new View.OnClickListener(){}, Class<FindFilesByType>) is undefined
Remove arguments to match 'Intent'
Что не так с тем, что я делаю?