I'm too tired for searched this question in two day's , but i got false answer , I implement RecyclerView and it worked well, but my RecycleView have many items like photo's and video's like Instagram . it mean my adapter will invoke onBindViewHolder for all items to start download and loading image's and video's . but RecycleView just invoked onBindViewHolder for each item's when item is visible (scroll show it) . it's impossible ? if not how instagram can do that . pay attention : i don't want to using database for save image's and video's
@Override
public void onBindViewHolder(RecyclerView.ViewHolder h, int position) {
Log.e("position",position+" ");
thread t = new Thread(new Runnable(){
public void run(){
Bitmap bitmap = downloadPhoto();//it mean photo downloaded and converted to Bitmap
runOnUiThread(new Runnable(){
holder.imageView.setImageBitmap(bitmap);
));
}
});
t.start();
}