There should be more information (like the line number) in the stack trace in the logcat output. Without knowing which line of code causes this we'd just be poking in the dark.
I don't think it matters which line actually causes the exception, several lines in the method do the same thing: cast the view passed to the method to a TextView. Apparently the view passed in is actually a RelativeLayout, not a TextView and so can't be cast that way.
The view gets passed in from dont(), but we can't tell from this code where dont() gets the view - all we know is that the view is not a TextView as expected. You need to figure out where the view comes from and why it is a RelativeLayout rather than the expected type.
Steve Luke wrote:I don't think it matters which line actually causes the exception, several lines in the method do the same thing: cast the view passed to the method to a TextView. Apparently the view passed in is actually a RelativeLayout, not a TextView and so can't be cast that way.
The view gets passed in from dont(), but we can't tell from this code where dont() gets the view - all we know is that the view is not a TextView as expected. You need to figure out where the view comes from and why it is a RelativeLayout rather than the expected type.
The Textviews are on a RelativeLayout layout.
Toasts are working after clicking on the textviews.
Kovacs Akos wrote:The Textviews are on a RelativeLayout layout.
That doesn't answer Steve's question of where that "View v" comes from that you're passing into the "dont" method. If that's a RelativeLayout object, that would explain what's happening.