Generate random data and pass it to RecyclerView with Adapter
My application has a couple of parameters Application level parameters in configuration what allow my application working in Android Emulator without real access to MMS and Real contacts.
My application inject test contact data and inject it to RecycledView.
This Data directly added to ArrayList instead real data what can be read from ContactList Using Query and Cursor to read data sequence and fill DataAdapter for RecyclerView
And than ContactAdapter allow to show this fake data on ContactActivity.
Similar approach I used with fake generated MMS for debugging, but I used random data.
I have created some Random messages.
In current program state each data item is just simple POCO class.
But, of course, next step is transform this class as implements Parcelable to allow processing click on RecycledView Row (in this pattern Pass data to new form with Intent and getParcelableExtra)
In current program state this random generated data just uploading to RandomMessageItemAdapter and show in RecycledView without processing RowClickEvent.
Of course, there are no any difficulties to continue processing row click, pack message to Parcelable parameter and then pass message to next activity with Intent and then show message in Android MediaPlayer on new Activity, but development was stop unexpectedly by financial reason. Without continue this was a minimal example to create Random Data and show it in RecycledView.
DataItem, of course, in this case allow to show icon and data.
AndroidMosaic context:
)
|
|