I am using the following logic, I have two buttons in my activity 1 button sets flag to F and the other to C, the SOP statement in the below code prints correct if the value of flag each if its F it prints F else it prints C. But the If else statements I dont know what goes wrong, In each of the if else state I am trying the setText for TextView depending upon the condition if its F or C but everytime C is being called. Dont know why.
   Bundle extras = getIntent().getExtras();
    if (extras != null) {
      flag = extras.getString("Flag");
      System.out.println(flag);
      if(flag == "F"){
        do F
      }
      else{
        do C
      }
    else{
      do F + C
    }
 
     
     
    