0
How to get numbers from edittext for operator
I have the code button.setOnClickListener(new view.onclicklistener() { @Override public void onclick (View v) { String valuetwo = edittext.gettext ().tostring (); not finalvalue = Integer.parseint (valuetwo); textview6.settext (valuetwo / valueone+""); } }}; } I get the error operator / cannot be applied to java.lang.string and double. I have valueone declared final double valueone = 3.5; can anyone help me?
4 ответов
0
not finalvalue should say
int finalvalue =Integer.parseint (valuetwo);
0
hello,
valuetwo is a string - you parse it into finalvalue but never use final value.
You need to do ( (finalvalue/valueone)+"")
0
works great! thank you
0
you're welcome :)