-3

I want to determine which value has been sent by different buttons that I have in my code. I have tried the code below. Thanks in advance!

if (intent.getExtras().getString("") == button1value){
}
WarrenFaith
  • 57,492
  • 25
  • 134
  • 150
Brianmuks
  • 49
  • 7

1 Answers1

2

You can't compare two strings with ==.

if (intent.getExtras().getString("").equals(button1value)) {
}
WarrenFaith
  • 57,492
  • 25
  • 134
  • 150