simonho1989
Lurker
Hello, I am completely new to coding
and have been trying to make a drug dosage calculator
the idea of the app is that there is a Seekbar on top for user to adjust the body weight
so that all the drug will spontaneously show the calculated dosage.
I have a successful attempt when making the first trial using one MainActivity and one XML file (referring to the pic success_trial.jpg)
However, when I do my second attempt to make a Tab Layout with Swipeable Views, the app force closed once I touch the Seekbar.(referring to the pic failed_trial.png)
I have been following this tutorial from androidhive.(http://www.androidhive.info/2015/09/android-material-design-working-with-tabs/)
Should those code for calculation and display done in the MainActivity class or in the fragment class?
I guess my main problem is that I don't know how to setText to or findViewById from another class. Any help is appreciated.
and have been trying to make a drug dosage calculator
the idea of the app is that there is a Seekbar on top for user to adjust the body weight
so that all the drug will spontaneously show the calculated dosage.
I have a successful attempt when making the first trial using one MainActivity and one XML file (referring to the pic success_trial.jpg)
However, when I do my second attempt to make a Tab Layout with Swipeable Views, the app force closed once I touch the Seekbar.(referring to the pic failed_trial.png)
I have been following this tutorial from androidhive.(http://www.androidhive.info/2015/09/android-material-design-working-with-tabs/)
Should those code for calculation and display done in the MainActivity class or in the fragment class?
I guess my main problem is that I don't know how to setText to or findViewById from another class. Any help is appreciated.