In my Android application, I have TextViewand SeekBar. Both values are used to calculate the result when the button is pressed.
The problem is how to write the value SeekBarand convert it to String for calculation.
Code below:
class clicker implements Button.OnClickListener {
public void onClick(View v) {
String a,b;
Integer vis;
a = txtbox3.getText().toString();
b = slider1.getContext().toString();
vis = (Integer.parseInt(a)*Integer.parseInt(b))/100;
tv.setText(vis.toString());
}
}
Please, help. Thanks in advance.
source
share