Solved, had to use getLongExtra instead of getIntExtra

On Oct 14, 6:53 pm, jax <jackma...@gmail.com> wrote:
> I am having a problem with an intent.  I open an activity using the
> following on a ListView.
>
>         public static final String LIST_ID =
> "com.example.myprogram.ListId";
>
>         //onClick listener
>         localListView.setOnItemClickListener(new OnItemClickListener()
> {
>
>                         @Override
>                         public void onItemClick(AdapterView<?> adapter, View 
> view, int
> position,
>                                         long id) {
>                                 //open the list
>                                 localClickIntent = new 
> Intent(ListManagement.this,
> ListStatistics.class);
>                                 
> localClickIntent.putExtra(ListManagement.LIST_ID, id);
>
>                                 startActivity(localClickIntent);
>
>                         }
>                 });
>
> I then retrieve that LIST_ID in ListStatistics like this
>
>                 Intent receivedIntent = getIntent();
>                 listId = receivedIntent.getIntExtra(ListManagement.LIST_ID, 
> 1);
>
> The problem is that the listId is always the default (1), and
> inspecting the extras on receivedIntent in eclipse shows not extras
> data.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to