title: How to show images to RecycleView using Glide?
body: <p>I have Sqlite database for images but it just store URL only and i want glide to process that URL to show the images , </p>
  
  <p>Case : I need to show images <strong>url</strong> from sqlite to recycleview using glide .</p>
  
  <p>Iam using this code because it makes me think simply than parsing data to from byte to image or whatever it is.</p>
  
  <p>Please help , now i got error "Java.lang.nullPointerException"</p>
  
  <pre><code>public class ListAdapter extends RecyclerView.Adapter&lt;ListAdapter.ListViewHolder&gt; {
  
      private Context mContext;
  
      private List&lt;Produk&gt; listList = new ArrayList&lt;&gt;();
  
      public ListAdapter(List&lt;Produk&gt; listList){
  
          this.listList = listList;
          this.mContext = mContext;
      }
  
      @Override
      public ListAdapter.ListViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  
          View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_list ,parent, false);
  
          ListViewHolder ListViewHolder = new ListViewHolder(view);
          return ListViewHolder;
      }
  
      @Override
      public void onBindViewHolder(ListAdapter.ListViewHolder holder, int position) {
  
          holder.txt_rKode.setText((listList.get(position).getKd_produk()));
          holder.txt_rNama.setText(listList.get(position).getNama_produk());
          holder.txt_rMerk.setText(listList.get(position).getMerk_produk());
          holder.txt_rJenis.setText(listList.get(position).getJenis_produk());
          holder.txt_rVariasi.setText(listList.get(position).getVariasi_produk());
          holder.txt_rFoto2.setText(listList.get(position).getFoto_produk());
  
          String currentUrl = listList.get(position).getFoto_produk();
  
          Glide.with(mContext)
                  .load(currentUrl)
                  .into(holder.iv_rFoto);
  
  
  
  
      }
  
      @Override
      public int getItemCount() {
          return listList.size();
      }
  
      public Produk getItem(int Position) {
          return listList.get(Position);
      }
  </code></pre>
  
  <p><strong>ERROR LOG</strong></p>
  
  <p>And Here it is , the Error log .</p>
  
  <pre><code>01-31 14:49:58.795 12577-12577/? E/AndroidRuntime: FATAL EXCEPTION: main
     Process: ptacs.ekatalog.com.e_katalogproduk, PID: 12577
     java.lang.NullPointerException: You cannot start a load on a not yet attached View or a Fragment where getActivity() returns null (which usually occurs when getActivity() is called before the Fragment is attached or after the Fragment is destroyed).
         at com.bumptech.glide.util.Preconditions.checkNotNull(Preconditions.java:31)
         at com.bumptech.glide.Glide.getRetriever(Glide.java:665)
         at com.bumptech.glide.Glide.with(Glide.java:697)
         at ptacs.ekatalog.com.e_katalogproduk.adapter.ListAdapter.onBindViewHolder(ListAdapter.java:56)
         at ptacs.ekatalog.com.e_katalogproduk.adapter.ListAdapter.onBindViewHolder(ListAdapter.java:23)
         at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6482)
         at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6515)
         at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5458)
         at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5724)
         at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5563)
         at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5559)
         at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2229)
         at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1556)
         at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1516)
         at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:608)
         at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3693)
         at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3410)
         at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3962)
         at android.view.View.layout(View.java:15604)
         at android.view.ViewGroup.layout(ViewGroup.java:4968)
         at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:610)
         at android.view.View.layout(View.java:15604)
         at android.view.ViewGroup.layout(ViewGroup.java:4968)
         at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
         at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
         at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
         at android.view.View.layout(View.java:15604)
         at android.view.ViewGroup.layout(ViewGroup.java:4968)
         at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:132)
         at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
         at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1361)
         at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:869)
         at android.view.View.layout(View.java:15604)
         at android.view.ViewGroup.layout(ViewGroup.java:4968)
         at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
         at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
         at android.view.View.layout(View.java:15604)
         at android.view.ViewGroup.layout(ViewGroup.java:4968)
         at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
         at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
         at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
         at android.view.View.layout(View.java:15604)
         at android.view.ViewGroup.layout(ViewGroup.java:4968)
         at android.widget.FrameLayout.layoutChildren(FrameLayout.java:573)
         at android.widget.FrameLayout.onLayout(FrameLayout.java:508)
         at android.view.View.layout(View.java:15604)
         at android.view.ViewGroup.layout(ViewGroup.java:4968)
         at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
         at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
         at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
         at android.view.View.layout(View.java:15604)
      at android.view.View
  </code></pre>