Passing Argument to an Intent

Knowledge Base Entry: #16
^Top
<< Back
Mobile-Menu










Passing Argument to an Intent
Category: Android/Snippets
Author: Bugfish
Created at: 2020-07-25 18:15:28
Modified at: 2025-09-20 01:06:25
Directs Hits: 796

Passing the parameter

Intent intent= new Intent(mContext,Activity.class);
intent.putExtra("test","value"));

Get value

Intent intent=getIntent();
msg_textview.setText(intent.getStringExtra("test"));

Caution: I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.
This Website is using Session Cookies for Site Functionality.