Android studio app crashing error : AndroidRuntime: FATAL EXCEPTION: main
First convert the String
data to only numeric
string using replaceAll
and then parse the numeric string data like :-
Integer.parseInt(stringData.replaceAll(",","")); // this should avoid the crash !
But to get the list of category id u should use split
by ,
like :-
String[] categoryIds = checkoutItemsList.get(i).getCustomersBasketProduct().getCategoryIDs().split(",");
Then convert the string array to int array
int[] intIds = Arrays.stream(categoryIds).mapToInt(Integer::parseInt).toArray();
AndroidRuntime: FATAL EXCEPTION: Nullpointerexception, Inflateexception
In the StickerView
file:
- Remove the
StickerView(Context context)
constructor - Put the initialization code also in the
StickerView(Context context, AttributeSet attributeSet)
constructor (creating a dedicated method is a good approach) and - Change
this(context, attributeSet, 0)
tosuper(context, attributeSet)
public StickerView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
setup();
}
public StickerView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
setup();
}
private void setup() {
this.mOldDistance = 0.0f;
this.mOldRotation = 0.0f;
this.mCurrentMode = ActionMode.NONE;
this.mTouchSlop = 3;
Paint paint = new Paint();
this.mBorderPaint = paint;
paint.setAntiAlias(true);
this.mBorderPaint.setColor(-16777216);
this.mBorderPaint.setAlpha(128);
this.mSizeMatrix = new Matrix();
this.mDownMatrix = new Matrix();
this.mMoveMatrix = new Matrix();
this.mStickerRect = new RectF();
**//Below line #129 the compiler select BitmapStickerIcon**
this.mDeleteIcon = new BitmapStickerIcon(ContextCompat.getDrawable(getContext(), R.drawable.ic_close_white_18dp));
this.mZoomIcon = new BitmapStickerIcon(ContextCompat.getDrawable(getContext(), R.drawable.ic_scale_white_18dp));
}
Fatal Exception: java.lang.ArrayIndexOutOfBoundsException at com.google.maps.api.android.lib6.gmm6.vector.ct
It is problem with Google Maps SDK, not with your app. Recommended solution is to clean app data from Settings. Or app reinstall.
You can track Google fixing this issue here: https://issuetracker.google.com/issues/154855417
Related Topics
Creating a PDF File in Android Programmatically and Writing in It
Viewpager Detect When User Is Trying to Swipe Out of Bounds
Run Code Only Once After an Application Is Installed on Android Device
How to Create a .CSV on Android
How to Get App's Permission for Each App? How to Do It Programmatically on Android
How to Add Action Bar from Support Library into Preferenceactivity
Creating Viewholders for Listviews with Different Item Layouts
Drag and Drop Items in Recyclerview with Gridlayoutmanager
No Good Example About Recyclerview and Staggeredgridlayoutmanager in Android Docs
What's Better? Notifydatasetchanged or Notifyitemchanged in Loop
Androidruntime: Fatal Exception: Androidmapsapi-Zoomtablemanager
How to Get Data from Service to Activity
Popupwindow $Badtokenexception: Unable to Add Window -- Token Null Is Not Valid
Mobile Vision API - Concatenate New Detector Object to Continue Frame Processing
Copy Database from Assets to Databases Folder
How to Start Power Manager of All Android Manufactures to Enable Background and Push Notification
Cannot Launch Avd in Emulator:Qt Library Not Found
Camera Preview Image Data Processing with Android L and Camera2 API