create recyclerview in 2nd activity from 1st activity recyclerview,how can i pass arraylist data from 1st recyclerview to 2nd activity recyclerview - arraylist

Suppose in my first activity there is 3 recyclerview named "10","20","30" ...and then if someone click on name"10" recyclerview then in second activtity name "1","2","3","4","5","6","7","8","9" total 9 recyclerviecwwill be open in second activity.....and if someone click on "20"" recyclerview then in second activtity name "11","12","13","14","15","16","17","18","19" total 9 recyclerview will be open in second activity.....and if someone click on "30" recyclerview then in second activtity name "21","22","23","24","25","26","27","28","29" total 9 recyalerview will be open in second activity.....so my question is that how can i pass RRECYCLERVIEW DATA from first activity...I CAN PASS NORMAL IMAGE,TEXT E.T.C. from first activity ....but i cant pass next activity recyclerview data from first recyclerview...please help
i created 2 model for 1st activity recyclerview and second activity recyclerview ....but i cant set the value for 2nd activity recyclerview using 1st activity recyclerview ...help

Related

Recyclerview Notifydatachange For only one item

I have a Recyclerview with a long list of items. One Item have a TextView, this TextView need change every 0.5 seconds, so i need refresh. All my code works perflecly but If I refresh all my items (notifyDataChange), its to slow. So I need refresh only this item for a good perfomance of my app. Its possible?
AdaptadorRecyclerView.notifyDataSetChanged();
Use adapter.notifyItemChanged(int position, Object payload). You can mention the TextView's position and value with payload parameter. If you want to learn more about it please refer [this link](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html#notifyItemChanged(int, java.lang.Object)).

How to save scrolling position of recyclerview list by updating RecyclerViewAdapter per second

(notifyDataSetChanged in onBindViewHolder is not working to update whole list per second . So I have updated list by creating new adapter per second time interval .)
To update counter and other chat data I have executed below lines periodically per second. It is getting scrolled up again and again.
So how to save scrollposition of the list even if it is updated periodically.
mAdapter = new ChatInfoRecyclerViewAdapter(getDataSet1());
//mAdapter.notifyDataSetChanged();
mRecyclerView.setAdapter(mAdapter);

Understanding RecyclerView

Let's assume that we have a RecyclerView with 100 rows. Every row contains a Spinner with values from 1-5 (default of 1).
I scroll down to item row #100, change it's value to 5 and then scroll back up to row #1, my questions is:
When i scroll down again to row #100, will i see the Spinner with value of 5 that i have selected earlier? or the default value of 1 since the RecyclerView will recycle items for re-use (performance boost) and not hold all 100 rows in memory.
Would love to get a good explanation on how this works.
Like you said, the RecyclerView will not hold the 100 rows in memory, hence the name RecyclerView. How many views of the same layout the RecyclerView will hold depends on how many of them fit on the screen.
When you change item #100's value to 5, you are altering one of the recycled views. Now, until you modify that ViewHolder (typically done in onBindViewHolder()), the view will stay the same, which means that that specific ViewHolder will still have 5 as its Spinner value; at any position you are in the list, not necessarily if you scroll down to item at #100, you will see one item with the Spinner value of 5.
Basicly, RecycleView is just that, a View.
So if you scroll to #100 and set spinner to 5, you need to save your selection to the underlying data array.
That way when you scroll to #1 and back to #100, when onBindViewHolder() is called correct value will be loaded and spinner in #100 will show 5.
RecycleView only optimizes UI, as Ari mentioned.

Displaying data on an laretdialog using titanium and remote database

i'm developping a mobile app using titanium appcelerator. in my app i have a tableview contains list of persons' name retrieved from remote database. when i click on each row of my tableview, i want to display some other data from remote database (the activity of each person of my list). i used a php web services to do this. i used a loop "For" to display data, but the problem that when i click on a row all data (all activity of persons are displayed). i tried to do this whitout loop, i can display now only one data (on click, only the activity of the first person is displayed for all rows of my tableview). i do not know what exacly should i put as condition or witch loop must be used for this.
Any help please. this is a screenshot of my tableview and the alert dialog: https://www.dropbox.com/s/osan0bb4i6s2bqd/scrennShot.png
You have to add the click EventListner to TableView..
Hope it will works for you...
and Pass the data object to TableRow when its created
var row = Ti.UI.createTableViewRow({
height : Ti.UI.Size,
left : 0,
obj : your_data[i] // From the array etc for specific row .
});
Add EventListner
e.rowData.obj;

how to get the item from listview to another listview?

How to do this thing i've been struggling with this thing all night long, i want to get the item from the listview to another listview. Like, when i select an item from the list view 1 i can get the total liters of it from the list view 2.