• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Calculator Aplication

hellhunt

Lurker
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?
 
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. :)
 
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
 
Back
Top Bottom