• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Android code to add two numbers

 
deepika deepi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i am an beginner in android. i want to add two numbers in android, working on eclipse and i am getting an error in the code

error:
txtbox1= (EditText) findViewById(R.id.txtbox1);
button1 = (Button) findViewById(R.id.button1);
tv = (TextView) findViewById(R.id.lbl1);
txtbox2= (EditText) findViewById(R.id.txtbox2);



can we correct the error and make the code run?
 
Tim Moores
Bartender
Posts: 3137
50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you going to tell us what the error is, or are we supposed to guess? Is it that "R.id" does not exist? Maybe this helps: http://stackoverflow.com/questions/3721950/android-helloviews-spinner-tutorial-r-id-and-r-array-can-not-be-resolved
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepika, I've added code tags and indentation for you this time. You can do so yourself by using the Code button when writing your post.
 
Maneesh Godbole
Saloon Keeper
Posts: 11342
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Android questions are best asked on the android forum. In future please do take out time to CarefullyChooseOneForum
Moving...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic