I need to transfer User and int between 2 activities, this happens when clicked on item in listview, Activity 1:
Intent intent = new Intent(GameActivity.this,ServerActivity.class);
intent.putExtra("serverNum",position);
intent.putExtra("currentUser",currentUser);
Log.d("position", position + "");
startActivity(intent);
finish();
the position is by defult the number of the item that the user clicked on, The log.d shows the currect position indeed, but when I try to get that Int in activity 2 its always 0.
In activity 2:
Log.d("Server Number",getIntent().getExtras().getInt("serverNum")+"");
this log.d always shows 0. the user transfers well though.
EDIT
I found out it has something to do with android:launchMode="singleTask" in the manifest, for some reason the activity opens twice, one opens well and one for some reason opens with the extra "serverNum" equals to 0, any suggestions on how to fix this?