I AM really sorry about my previous question,I want to express it SPECIFICALLY,This code dose not work properly,the str string is correct but i use 4 if.. else I think this part of this code dosen't work properly and it dese not have any output.Thank You
else if(src.endsWith("=")){
String str=t.getText();
for(int i=0;i<str.length()-1;i++){
char fn =str.charAt(i);
if(fn=='+'){
String s1=str.substring(0, i-1);
String s2=str.substring(i, str.length()-1);
int x=Integer.parseInt(s1);
int y=Integer.parseInt(s2);
String result=(x+y)+" ";
t.setText(result);
}
else if(fn=='-'){
String s1=str.substring(0, i-1);
String s2=str.substring(i, str.length()-1);
int x=Integer.parseInt(s1);
int y=Integer.parseInt(s2);
String result=(x-y)+" ";
t.setText(result);
}
else if(fn=='*'){
String s1=str.substring(0, i-1);
String s2=str.substring(i, str.length()-1);
int x=Integer.parseInt(s1);
int y=Integer.parseInt(s2);
String result=(x*y)+" ";
t.setText(result);
}
else if(fn=='/'){
String s1=str.substring(0, i-1);
String s2=str.substring(i, str.length()-1);
int x=Integer.parseInt(s1);
int y=Integer.parseInt(s2);
String result=(x/y)+" ";