It is necessary to transfer a line from one Activiti to another. I do in the main activit:

Intent intent = new Intent(ActivityScreen0.this, ActivityScreen8_pages.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); intent.putExtra("page", "news"); startActivity(intent); 

Into which data is sent to:

 String page = getIntent().getStringExtra("page"); 

Now the question is, this comparison does not work:

 if(page == "news"){ } 

I can not understand why, apparently, the lines for some reason are not equal, but for what reason?

    1 answer 1

    The issue is resolved. I was wrong. For comparison, use string.equals (string) or string.equalsIgnoreCase (string).