I am a relative newbie to Android and am trying to learn how to pass
an int value to another activity.

Main activity uses a ListView. The following onitemClick method is
supposed to communicate the
position value to the playalphabet activity.

public void onItemClick(AdapterView<?> a, View v, int position, long
id) {
    Intent intent = new Intent(v.getContext(),
        playalphabet.class);
    intent.putExtra("selections", position);
    startActivityForResult(intent, 0);
}

When a button click is detected in the playalphabet activity, it is
supposed to retrieve the
position value, but position is always zero.

Any advice is appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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