Using an object in an if statement... (Android)

Posted by James Rattray on Stack Overflow See other posts from Stack Overflow or by James Rattray
Published on 2010-04-25T17:31:44Z Indexed on 2010/04/25 17:33 UTC
Read the original article Hit count: 301

Filed under:
|
|
|

I have an object variable Object test = Spinner.getSelectedItem(); -It gets the selected item from the Spinner (called spinner) and names the item 'test'

I want to do an if statement related to that object e.g:

'if (test = "hello") {
//do something
}'

But it appears not to work....

Can someone give me some help? -Do I have to use a different if? or convert the object to string etc.?

Thanks alot...

James

© Stack Overflow or respective owner

Related posts about object

Related posts about if