can you paste here the full code

On Fri, Jul 15, 2016 at 3:14 AM, essien david <[email protected]>
wrote:

> 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
> <https://groups.google.com/d/msgid/android-developers/03637173-a76f-40d1-b25b-62b5e8352cd3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CABHzXATrUSvhZ4c2pqcJKCGUV%2BZfQPu4%2BWb8wDk5n8_wpF5Tfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to