Комментарии:
please how do i add square root and power
Ответить@CodesEasy i am getting error like Constant expression required in the place of swith case
Ответитьwhich app
ОтветитьMy code doesn't find view.getId() from the switch ,what should I do?
Ответитьgreat work
Ответитьhow to show . 33 after divided
2 decimal place code pls
sorry but my answers is not showing up in the textview
ОтветитьIts very nice, but please don't rush the teaching, it's better to thoroughly explain each step for what and how it works. ❤
ОтветитьSir I'm getting this
Case R.id.btn
Hello sir I'm having an error at the end saying constant expression expected 😢😢
Ответитьim having with the case step...
Ответитьinstead of using switch you can use if-else conditions such as
@Override
public void onClick(View view) {
N1 = getIntFromEditText(editTextN1);
N2 = getIntFromEditText(editTextN2);
if(view.getId()== R.id.btn_addition){
textView.setText("Answer = " + (N1 + N2));
}
else if (view.getId()== R.id.btn_subtraction){
textView.setText("Answer = " + (N1 - N2));
}
else if (view.getId()== R.id.btn_multiplication){
textView.setText("Answer = " + (N1 * N2));
}
else if (view.getId()== R.id.btn_division){
textView.setText("Answer = " + ((float)N1 - (float)N2));
}
}
}
Instead of using switch case you can use if-else conditions like this:
if(view.getId()== R.id.btn_addition){
textView.setText("Answer = " + (N1 + N2));
}
else if (view.getId()== R.id.btn_subtraction){
textView.setText("Answer = " + (N1 - N2));
}
else if (view.getId()== R.id.btn_multiplication){
textView.setText("Answer = " + (N1 * N2));
}
else if (view.getId()== R.id.btn_division){
textView.setText("Answer = " + ((float)N1 - (float)N2));
}
Such a great tutorial for beginner. Really appreciate.
I am unable to download source code ,kindly help to get code for practice.
Thanks sir for this video
Ответитьcan i get thee complete code ??
front end and back end bothj ??
hello sir thanks for sharing the education, i have question for you, why you use linear layout instead use constraint layout?
imo constraint layout more option for layout, thanks for answer
i use it for my homework thanks❤
ОтветитьHow to resolve the error "Constant expression required" on case R.id.btn_add:?
ОтветитьHow to remove error
Case R.id.btn
Constant expression required
Sir I am getting gradle sync error in Android studio how can I fix it pls tell I want to do Android development Also tell if I can do Android development in intellij idea pls
Ответитьsir mere pass error aa rha hai kase fix hoga plz btao
Ответить