Please i am building an app and i keep having an error in the app
getIntExtra keeps returning the default value.
here is the code:

                Intent i = new Intent(MonthGridActivity.this, 
DevotionListActivity.class);
                int newPosition = position+1;
                i.putExtra("monthId", newPosition);
                startActivity(i);

public int getMonthId(){
        int monthId;
        Intent i = getIntent();
        monthId = i.getIntExtra("monthId", 0);
        return monthId;
    }

I keep getting 0 as the return value. please help

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/03637173-a76f-40d1-b25b-62b5e8352cd3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to