I have a question:
I have a list (for example with Names from my friends) in activity “a”. When i click on one of the names(example: peter) i want to start a new activity “b”. At this activity i want to show number, birthday … from this person (peter).
Intent intent = new Intent(this, activityb.class);
startActivity(intent);
Can I insert here a parameter?
How knows activity “b” that activity a clicked the name peter…. ? I dont have any idea…. Normally i will save it with a special parameter for my function… But this is activity…..
You can add extra values to the intent in activity A by using putExtra() and use getStringExtra() (or getLongExtra(), getIntExtra(), etc.) to retreive them in activity B
Take a look at this page:
http://developer.android.com/reference/android/content/Intent.html