Home » Android » Cannot get value from always null bundle [duplicate]

Cannot get value from always null bundle [duplicate]

Posted by: admin November 1, 2017 Leave a comment

Questions:

This question already has an answer here:

Answers:

Don’t

 if(type == 

Do

if(type.equals("YOUR_STRING"))

You should use equals()

Compares this string to the specified object. The result is true if
and only if the argument is not null and is a String object that
represents the same sequence of characters as this object.

if (type.equals("RAW_TYPE")) {
        rhs1 = new RawHttpSensor();
        temperature = (TextView) findViewById(R.id.temperature);
        rhs1.registerListener(this);
        rhs1.getTemperature();
    }