• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Android Glide load saved drawable in variable

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey all I have looped to gather game icons which I put them into a variable that is inside an class:



In my mainActivity:



And I'm calling that back up once Glide populates that page by doing this:



But it seems to crash my app once it gets to the load(...) part. I know it has the app icon because I check it out using this:


and it came up just fine.

So what is it that I am missing in order to load these drawable variables into Glide?

LOG

2022-04-15 08:14:20.374 18885-18885/com.tutorialscache.tabslayout E/AndroidRuntime: FATAL EXCEPTION: main
       Process: com.tutorialscache.tabslayout, PID: 18885
       java.lang.NullPointerException: Argument must not be null
           at com.bumptech.glide.util.Preconditions.checkNotNull(Preconditions.java:29)
           at com.bumptech.glide.util.Preconditions.checkNotNull(Preconditions.java:23)
           at com.bumptech.glide.RequestBuilder.into(RequestBuilder.java:841)
           at com.example.telluridetainment.adapter.AndroidAdapter.onBindViewHolder(AndroidAdapter.java:62)
           at com.example.telluridetainment.adapter.AndroidAdapter.onBindViewHolder(AndroidAdapter.java:24)
           at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
           at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
           at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
           at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
           at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
           at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
           at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
           at androidx.recyclerview.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:557)
           at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
           at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
           at androidx.recyclerview.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:171)
           at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
           at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
           at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
           at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
           at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1775)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1915)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
           at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
           at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
           at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
           at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
           at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
           at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
           at android.view.View.layout(View.java:21912)
           at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
           at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
           at com.android.internal.policy.DecorView.onLayout(DecorView.java:779)
           at android.view.View.layout(View.java:21912)
   2022-04-15 08:14:20.377 18885-18885/com.tutorialscache.tabslayout E/AndroidRuntime:     at android.view.ViewGroup.layout(ViewGroup.java:6260)
           at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3080)
           at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2590)
           at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1721)
           at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7598)
           at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
           at android.view.Choreographer.doCallbacks(Choreographer.java:790)
           at android.view.Choreographer.doFrame(Choreographer.java:725)
           at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
           at android.os.Handler.handleCallback(Handler.java:883)
           at android.os.Handler.dispatchMessage(Handler.java:100)
           at android.os.Looper.loop(Looper.java:214)
           at android.app.ActivityThread.main(ActivityThread.java:7356)
           at java.lang.reflect.Method.invoke(Native Method)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

 
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic