Stack Overflow archive
0 score

Android - pass several parameters with putExtras between two activities

score
0
question views
83
license
CC BY-SA 3.0

Two problems I see:

1: You are calling startActivityForResult twice. You can pass extras using intent.putExtra(...).

2: You don't have a break in your switch statement:

java
switch(requestCode) {
    case ACTIVITY_COLOR_REQUEST_CODE:
        fingerPainterView.setColour(Color.parseColor(color)); // set new color value
    break;
    case ACTIVITY_BRUSH_SIZE_REQUEST_CODE:
        Log.d("FingerPainter", "Main activity change brush size to " + size);
    break;
    case ACTIVITY_BRUSH_SHAPE_REQUEST_CODE:
        Log.d("FingerPainter", "Main activity change brush shape to " + shape);
    break;
}

Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.