I have an adapter class and calling startActivityForResult()
and getting the result in my Activity where I am using the adapter.
I want to change the image view background on getting the result.And the change should effect only the particular position of the RecyclerView
.
startActivityForResult()
inside the adapter class: pass the context to your adapter class and do this:
((Activity)context).startActivityForResult(...);
As far as updating the RecyclerView
, you can get the position inside the onBindViewHolder()
and just update the class object from the List
or ArrayList
for the image and call notifyDataSetChanged()
after that.
PS this is the best I can do to explain to you without any code.
Edit : to get the TextView
from the adapter class inside the Activity class:
View viewItem = recycleView.getLayoutManager().findViewByPosition(position);
TextView textView = viewItem.findViewById(R.id.textView);
textView.setTextColor(getResources().getColor(R.color.yourColor));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.