Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to go to another activity using intent in custom adapter

This is my Adapter and EditMeal Activity.My main activity have only listView. Inside this adapter have many different edittext component. And i want to pass my info which is display on my listview in main activity to editMealActivity when listview is clicked.


  • Grace1234Grace1234 Member ✭✭
    edited November 2019

    This is what in my custom adapter, Full coding in that document

  • Grace1234Grace1234 Member ✭✭

    This is my editMealActivity

  • JarvanJarvan Member, Xamarin Team Xamurai

    Save the data in a Bundle and add a set of extended data to the intent using Intent.putExtras method. Retrieves the extended data from the intent, then set it for EditText.

    MainActivity class

    public class MainActivity extends AppCompatActivity {
        protected void onCreate(final Bundle savedInstanceState) {
            list = new ArrayList<String>();
            Adapter_ adapter = new Adapter_(this,R.layout.layout1,list);
            ListView listview = (ListView)findViewById(;
            listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                    Intent intent = new Intent(MainActivity.this,NavgationActivity.class);
                    Bundle bundle = new Bundle();
                    bundle.putString("pass_value", list.get(position));

    NavgationActivity class

    public class NavgationActivity extends Activity {
        protected void onCreate(Bundle savedInstanceState) {
            EditText editText = (EditText)findViewById(;
            Bundle bundle = getIntent().getExtras();
                String pass_value = bundle.getString("pass_value");

    Besides, the forums is about Xamarin. For native Android problem with jave, you can post such issues on stackoverflow where experts can better assist.

Sign In or Register to comment.