Intent's Extra Is Always Null
I'm trying to pass an int variable to another activity: From the current activity: Intent intent = new Intent(getApplicationContext(),PlayActivity.class); intent.putExtra('posi
Solution 1:
There is no string extra to get since it is an int
. You should have
Intentintent= getIntent();
intposition= intent.getIntExtra("position");
I'm not sure why you are trying to get a String
then parse to an int
when it is sent as an int
, assuming position
is an int
in your first Activity
. If that is not the case then please explain a little better.
Post a Comment for "Intent's Extra Is Always Null"