Brian_Alexander Asked: 2020-04-06 14:25:25 +0800 CST 2020-04-06 14:25:25 +0800 CST 2020-04-06 14:25:25 +0800 CST How to listen to a TextView in Android Studio? 772 I am doing a Login, I would like to listen to a TextView, a Cardview and an Editext so that they work as buttons. Thanks. java 1 Answers Voted Best Answer Kevin Puscan Ortiz 2020-04-06T14:38:20+08:002020-04-06T14:38:20+08:00 In your method onCreateViewget your text_view or whatever you want and give it a function to execute on click. tu_text_view.setOnClickListener(tu_funcion); outside the method declare your function private View.OnClickListener tu_funcion = new View.OnClickListener() { @Override public void onClick(View v) { //todo lo que deseas que haga } };
In your method
onCreateView
get your text_view or whatever you want and give it a function to execute on click.outside the method declare your function