Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Weather App (2015) Hooking Up the Model to the View Setting the Weather Icon

Umy Ikem
Umy Ikem
21,383 Points

Having an error with mCurrentWeather.getIconId() method

private void updateDisplay() {
        mLocationlabel.setText(mCurrentWeather.getTimeZone());
        mTimelabel.setText("at " + mCurrentWeather.getFormarttedTime() + " it will be");
        mTemperaturelabel.setText(mCurrentWeather.getTemperature() + "");
        mHumidityValue.setText(mCurrentWeather.getHumidity() + "%");
        mPrecipValue.setText(mCurrentWeather.getPrespChance() + "");
        mSummaryTxtview.setText(mCurrentWeather.getSummary());


        Drawable drawable = ResourcesCompat.getDrawable(getResources(), mCurrentWeather.getIconId(), null);
        mIconimageview.setImageDrawable(drawable);
    }

the getIconId() is in red and when i put my mouse over is i see.........Cannot resolve method 'getIconId()'

pls help i've been stuck here for hours

Ben Deitch
Ben Deitch
Treehouse Teacher

Does your CurrentWeather.java class contain a getIconId method?