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 Creating the Item Layout

Carl Sergile
Carl Sergile
16,570 Points

What would you do?

Hey so what would you do if you wanted to keep the hourly forecast on one screen instead of using an intent? Where would the the recyclerView be in the xml? Currently mine:

            <android.support.v7.widget.RecyclerView
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:id="@+id/recyclerView"
            android:layoutB="@+id/precipValue"
            android:scrollbars="horizontal"
            android:background="@android:color/holo_purple"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"/>
 </RelativeLayout>

Since I don't want to use an intent and I want to keep the recyclerView on one page how do I grab that data as this code is invalid to me:

Parcelable[] parcelables = intent.getParcelableExtra.(MainActivity.HOURLY_FORECAST);
        mHours = Arrays.copyOf(parcelables, parcelables.length, Hour[].class);

Any help on this would be great!

J A
seal-mask
.a{fill-rule:evenodd;}techdegree
J A
Full Stack JavaScript Techdegree Student 4,646 Points

Consider updating your title to summarize your question, so that people will know what you are asking and can therefore help out. Maybe something like "How do I use the Hourly forecast without an intent?"