i have added onClick in my mainactivity for my textview and i had no errors but when i run the app it crashes saying app has stopped working even though i have no errors in my c
the problem is here someLayout = (LinearLayout) findViewById(R.id.state2);
someLayout = (LinearLayout) findViewById(R.id.state2);
you are trying to cast textview to linearlayout.
use yourtextview = (TextView) findViewById(R.id.state2);
yourtextview = (TextView) findViewById(R.id.state2);