• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Why my variables are not working in android studio?  RSS feed

 
Greenhorn
Posts: 22
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've given separate id for my variables in activity_main.xml file but when I tried to link it to MainActivity.java, it showing error.

I've given screenshot of my code for reference.
 
Rancher
Posts: 3350
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are there any errors in the xml file you posted?
Have you tried a Clean?
 
Rancher
Posts: 3760
40
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And can I suggest actually posting text here rather than images as a lot of people (like me) won't be able to view the images.
And, to be honest, text is a lot easier to deal with.
 
Ranch Hand
Posts: 570
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also make sure your xml file named activity_main.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe your R import file is wrong.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!