How to pass value using Intent between Activity in Android?

Replace this,

String value = getIntent().getExtras().getString("bucketno");

with

int value = getIntent().getExtras().getInt("bucketno");

You are trying to pass int value but retrieving String Data. That’s why you are getting the nullpointerException.

Leave a Comment