I defined TextView like : TextView newTextView;
then compiling the line:
newTextView = (TextView) findViewById(R.id.textView);
Android-studio gives error > cannot find symbol variable newTextView? At the same time Studio is acting weird like this variable name won't go into the blue color, there is "j" icon by the class names in the project structure and similar. Anybody know what happened to my project?
It's working on my code that I've tested it...
Just make sure that you've imported this :
import android.widget.TextView;
And then make a Clean project.
It's a problem of your SDK so better solution is update it.
If you're following the Google Android tutorial, when you create the second layout activity, and you pick a TextView widget, the ID of this widget it's "textView2".
You can:
Modify the findViewById() method and select the "textView2" view.
Or rename de ID of the view to "textView".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With