I pass some values โโthrough Intent, in some case the value passed through it returns null. The value is not null until it is set to intent. Here is the code where I set the intent.
Intent propertyIntent = new Intent(mContext , SomeActivity.class); propertyIntent.putExtra(START_MODE_TAG,MODE_EDIT_RECORDING); propertyIntent.putExtra(ACTIVITY_MODE_TAG, "dm"); propertyIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); propertyIntent.putParcelableArrayListExtra("det_list", detList); mContext.startActivity(propertyIntent);
Here is the code used to extract intent values
passedModeName = getIntent().getStringExtra(DMApplication.START_MODE_TAG);
only a START_MODE_TAG value returns null rest, everything returns correctly. I also tried setting to onNewIntent() . But to no avail.
The constants that I used in it
public static final String ACTIVITY_MODE_TAG="activity_mode"; public static final String START_MODE_TAG="StartMode"; public static final String MODE_NEW_RECORDING="new"; public static final String MODE_EDIT_RECORDING="edit"; public static final String MODE_REVIEW_RECORDING="review"; public static final String MODE_COPY_RECORDING="copy"; public static final String MODE_LAUNCH_RECORDING="launch";
source share