Dude, Use Java functions equals or compareTo, "==" operator won't work
Cheers, Tej On May 9, 11:04 pm, "Kevin J. Brooks" <[email protected]> wrote: > I am trying to pass a simple string in to a new activity. I feel a > little dense. I have looked at the samples, and I just can't seem to > get it through my thick head. What do I need in the first parameter. > > public static final String DRINK_TYPE = "type"; > . > . > . > Intent i = new Intent(this, BeerScreen.class); > i.putExtra(DRINK_TYPE, "beer"); > > Then in BeerScreen.java > > String sType = extras.getString("type"); > if(sType == "beer"){ > > The code inside the if is not executed. <sigh> > > Kevin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

