How can I solve this?
View IDs: Hello friends, where is my wrong?
Copy-paste textView.setText(""); into onCreate function
Variable textView in function onNoButtonClick(View view) is not defined (for more check local variables and global for extra help). You can see that AIDE shows red underline there.
To fix this you have kinda a few options:
- remove (comment with //) underlined command.
- Make textView variable global by moving textView outside of onCreate class:
onCreate(Bundle bundle){
TextView textView = (TextView)…
}
To
private TextView textView;
onCreate(Bundle bundle){
textView = (TextView)…
}
Thank you very much for your reply…
But the app has crashed and doesn’t work.
Sorry to disturb you again and again.