How do I get extra data from intent on Android? -
how can send info 1 activity (intent) another?
i utilize code send data:
intent i=new intent(context,sendmessage.class); i.putextra("id", user.getuseraccountid()+""); i.putextra("name", user.getuserfullname()); context.startactivity(i);
first, intent has started activity using getintent()
method:
intent intent = getintent();
if info represented strings, can utilize intent.getstringextra(string name)
method. in case:
string id = intent.getstringextra("id"); string name = intent.getstringextra("name");
android android-intent
No comments:
Post a Comment