Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old January 28th, 2013, 11:12 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Jan 2013
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Calculator Aplication

I'm doing a calculator app that takes two numbers and add, subtracts, multiplicates and divide them. The problem with this application is that when I click a Button (add button, subtract button, multiplication button or divide button) without writing one of the two number first the app crashes.
How can I resolve this problem?

hellhunt is offline  
Reply With Quote
sponsored links
Old January 28th, 2013, 01:11 PM   #2 (permalink)
=Luceat Lux Vestra=
 
Frisco's Avatar
 
Join Date: Jan 2010
Gender: Male
Posts: 22,492
 
Device(s): HTC One, Galaxy Tab 7" 2 Rooted
Carrier: Verizon

Thanks: 7,156
Thanked 9,262 Times in 5,117 Posts
Default

Quote:
Originally Posted by hellhunt View Post
I'm doing a calculator app that takes two numbers and add, subtracts, multiplicates and divide them. The problem with this application is that when I click a Button (add button, subtract button, multiplication button or divide button) without writing one of the two number first the app crashes.
How can I resolve this problem?
Welcome to Android Forums, hh.

I'm not a developer, but I'm sure a dev will pop in and lend specific assistance, but meantime, does this site have a clue to your issue:

Introduction to Android development : TouchCalculator - CodeProject

Come back and let us know how things are going, plus to check with the app developers in here.
__________________



Frisco is offline  
Reply With Quote
Old January 28th, 2013, 02:29 PM   #3 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,936
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 478 Times in 292 Posts
Default Re: Calculator Aplication

Your prolly get a null pointer exception because you are trying to operate on something that isnt there. Im assuming you are typing the number out, so make sure the text can be converted to a float/double
__________________
My blog, Inverted Keystrokes, is looking for aspiring developers (not necessarily with Android) to post articles. If you have any development experience and are interested in participating, please PM me. =)
jonbonazza is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:00 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.