Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getIcon().equals not giving the expected result.  RSS feed

 
Ricardo Wagemaker
Ranch Hand
Posts: 34
1
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quick question,

When I run that query it always set the icon to icon4 even if it is already set. Can some one please advise, I want in first instance set it to icon4 and then if i run again set it to icon5, i hope I am making sense.





Many Thanks
 
Ricardo Wagemaker
Ranch Hand
Posts: 34
1
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok not exactly what I was looking for but I found a way around it, by converting it to string I then compare the string version and perform the next step...

 
Rob Spoor
Sheriff
Posts: 21087
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never compare Strings using ==, always use the equals method.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!