It should be straightforward, but I am not sure where something is wrong.
I try to catch the click on the TextView with:
public void runNextTask(){
You can remove this:
android:onClick="onClick"
Or, remove this:
modelTextview.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
}
});
and have this:
public void onClick(View v)
{
// do something
}
android:onClick="onClick"/> // It would be better to rename the method to avoid confusion
Also, you have this:
so initialize your TextView as below:
TextView modelTextview = (TextView)addView.findViewById(R.id.model);