I am programming an RSS feed type app and on devices that are older than android 7.0, they will often get an android.util.AndroidRuntimeException and I cannot quite figure out why they are getting it. EDIT** The error is happening when a card (using cardview and recyclerview) is clicked on which will take the user to the corresponding URL.
The error itself is:
android.util.AndroidRuntimeException:
at android.app.ContextImpl.startActivity (ContextImpl.java:672)
at android.app.ContextImpl.startActivity (ContextImpl.java:659)
at android.content.ContextWrapper.startActivity (ContextWrapper.java:331)
at com.hillsdalewatch.rssfeed.Adapter.FeedAdapter$1.onClick (FeedAdapter.java:138)
at com.hillsdalewatch.rssfeed.Adapter.FeedViewHolder.onClick (FeedAdapter.java:52)
at android.view.View.performClick (View.java:5205)
at android.view.View$PerformClick.run (View.java:21164)
at android.os.Handler.handleCallback (Handler.java:745)
at android.os.Handler.dispatchMessage (Handler.java:95)
at android.os.Looper.loop (Looper.java:148)
at android.app.ActivityThread.main (ActivityThread.java:5417)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)
Whereas, FeedAdapter:138 is "mContext.startActivity(i);" which opens another activity that is basically just a webview and i is the url.
FeedAdapter:52 is "itemClickListener.onClick(v, getAdapterPosition(), true);" which is in an onClick method.
The app runs and works perfectly on any device running 7.0 or higher. Is there something I am overlooking that doesn't work on older devices?