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;
}
In the code above, I’ve written my adapterclass.
There are 3 buttons in my explandable list as a child.
I want to call another Java class on button’s click event,
so, when I am using:
Intent i=new Intent(this,FindFilesByType.class);
I am getting this:
The constructor Intent(new View.OnClickListener(){}, Class<FindFilesByType>) is undefined
Remove arguments to match 'Intent'
What is wrong with what I am doing?
this above methos into the adapter class this is fully working code for me 🙂