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 Android Lists and Adapters (2015) Lists with RecyclerViews Using a Layout Manager

App crash 'Widget can not fit on this device'

I'm running the Stormy app on a Moto G device, the ListView for daily weather works fine, but when I switch to the hourly weather view the app crashes and I get about five 'can not fit on this device' errors. The RecyclerView and parent layout are both set to match_parent for height and width, and the hourly_list_item.xml is set to match_parent for width and wrap_content for height.

05-22 14:21:40.060 1349-1349/? E/AppsCustomizePagedView﹕ Widget ComponentInfo{com.devexpert.weather/com.devexpert.weather.view.WidgetWeather5x1Cur} can not fit on this device (736, 80) 05-22 14:21:40.068 1349-1349/? E/AppsCustomizePagedView﹕ Widget ComponentInfo{com.devexpert.weather/com.devexpert.weather.view.WidgetWeather5x1} can not fit on this device (736, 80) 05-22 14:21:40.076 1349-1349/? E/AppsCustomizePagedView﹕ Widget ComponentInfo{com.devexpert.weather/com.devexpert.weather.view.WidgetWeather5x2LC} can not fit on this device (736, 220) 05-22 14:21:40.077 1349-1349/? E/AppsCustomizePagedView﹕ Widget ComponentInfo{com.devexpert.weather/com.devexpert.weather.view.WidgetWeather5x2} can not fit on this device (736, 220) 05-22 14:21:40.086 1349-1349/? E/AppsCustomizePagedView﹕ Widget ComponentInfo{com.devexpert.weather/com.devexpert.weather.view.WidgetWeather5x3} can not fit on this device (736, 330)

These are the exact errors I am getting.

1 Answer

I found out what it was. I forgot to add a blank string to an int value while assigning it to a TextView.setText() method.