This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Android and the fly likes Android code to add two numbers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Mobile » Android
Bookmark "Android code to add two numbers" Watch "Android code to add two numbers" New topic

Android code to add two numbers

deepika deepi
Ranch Hand

Joined: Jan 23, 2012
Posts: 199

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

txtbox1= (EditText) findViewById(;
button1 = (Button) findViewById(;
tv = (TextView) findViewById(;
txtbox2= (EditText) findViewById(;

can we correct the error and make the code run?
Tim Moores

Joined: Sep 21, 2011
Posts: 2409
Are you going to tell us what the error is, or are we supposed to guess? Is it that "" does not exist? Maybe this helps:
Martin Vajsar

Joined: Aug 22, 2010
Posts: 3718

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

Joined: Jul 26, 2007
Posts: 10744

Android questions are best asked on the android forum. In future please do take out time to CarefullyChooseOneForum

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Don't get me started about those stupid light bulbs.
subject: Android code to add two numbers
It's not a secret anymore!