I have a TableLayout in which I add rows dynamically, first empty, and I want to load the xml in that row when the user clicks on it.
I have assigned the OnClick method to the string, but I do not know how to load the xml when it enters the onclick method.
public void onClick(View v){
Toast.makeText(getApplicationContext(), "This should appear", Toast.LENGTH_SHORT).show();
}
I tried using inflate, but it seems I am not using it properly, because the application crashes when I click on a line.
How can I make a string contain xml?
source
share