I want to launch an intent but it gives me an error and I do not locate the why. Any suggestions I get the error when creating the intent:
@Override
public View getChildView(int groupPosition, final int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
tempChild = (ArrayList<String>) Childtem.get(groupPosition);
TextView text = null;
if (convertView == null) {
convertView = minflater.inflate(R.layout.childrow, null);
}
text = (TextView) convertView.findViewById(R.id.textView1);
text.setText(tempChild.get(childPosition));
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dato = tempChild.get(childPosition);
Toast.makeText(activity, dato,
Toast.LENGTH_SHORT).show();
Intent intent = new Intent(NewAdapter.this, Ficha.class);
intent.putExtra("id", id);
activity.startActivity(intent);
}
});
return convertView;
}
NewAdapter.java is a class that extends from BaseExpandableListAdapter.