I am trying to make an if statement to change the value of 3 variables. The problem is that i don't get any value even if the condition is true:
here I get the string that I want to check:
final String[] pos_categ ;
pos_categ = intent1.getExtras().getStringArray("categ");
Here I implement the variables that i want to change:
String[] title = null;
String[] eng = null;
final String[] dan = null;
Here is the if statement:
if (pos_categ[0]==lessons_titles[0]){
title[0] = lessons_titles[position[0]];
eng[0] = eng_version[position[0]];
dan[0] = dan_version[position[0]].toLowerCase();
}
if (pos_categ[0]==lessons_titles2[0]){
title[0] = lessons_titles2[position[0]];
eng[0] = eng_version2[position[0]];
dan[0] = dan_version2[position[0]].toLowerCase();
}
if (pos_categ[0]==lessons_titles3[0]){
title[0] = lessons_titles3[position[0]];
eng[0] = eng_version3[position[0]];
dan[0] = dan_version3[position[0]].toLowerCase();
}
if (pos_categ[0]==lessons_titles4[0]){
title[0] = lessons_titles4[position[0]];
eng[0] = eng_version4[position[0]];
dan[0] = dan_version4[position[0]].toLowerCase();
}
if (pos_categ[0]==lessons_titles5[0]){
title[0] = lessons_titles5[position[0]];
eng[0] = eng_version5[position[0]];
dan[0] = dan_version5[position[0]].toLowerCase();
}
if (pos_categ[0]==lessons_titles6[0]){
title[0] = lessons_titles6[position[0]];
eng[0] = eng_version6[position[0]];
dan[0] = dan_version6[position[0]].toLowerCase();
}
title_view.setText(title[0]);
eng_view.setText(eng[0]);
dan_view.setText(dan[0]);
Can someone tell me where I've made a mistake ?