Adding OnClick(View v) in a textview

后端 未结 4 453
鱼传尺愫
鱼传尺愫 2021-01-28 08:55

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

4条回答
  •  悲哀的现实
    2021-01-28 09:34

    Your id for linear layout and text-view both are same or what, if it is so, then change the id of linear layout. by below line of code it is clear that you have assigned same id to linear layout and text-view.

    someLayout = (LinearLayout) findViewById(R.id.state2);
    

提交回复
热议问题