when I am running the code in debugging ,it's working fine and give the desired output. but when I am running its normal mode ,its crashing and giving above exception. Getting Error when I m add an item through adapter into its BaseClass
HashMap<String,String> mMapWishList = new HashMap<String, String>();
String id = mProducts.getSingleProductId.get(position);
String name = mProducts.getSingleProductName.get(position);
String price = mProducts.getSingleProductPrice.get(position);
String oldPrice = mProducts.getSingleProductOldPrice.get(position);
String discount = mProducts.getSingleProductDiscount.get(position);
String description = mProducts.getSingleProductDescription.get(position);
getting only single item How can I add multiple items ? getting this error LogCatt Error
FATAL EXCEPTION: main
java.lang.IndexOutOfBoundsException: Invalid index 1, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
at java.util.ArrayList.get(ArrayList.java:308)
atcom.example.dev.newkhreedapp1.views.adapters.Product_Adapter$1.onClick(Product_Adapter.java:193)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
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)
why it's behaving like this ,not getting any clue. Thanks for any help.