Search code examples
javaandroidandroid-intentbundle

List with number input and its retrieval


If I created a list and designed an EditText(number input) for every item, how can i retrieve the input and display it on another page (either in a table or another list?) I'm new to android studio, please someone help.


Solution

  • You should learn Bundle and Intent , by using Intent you can pass data from one Activity to another Activity .

    And you can add any primitive data into Bundle and then add bundle object into calling activity intent and then get Bundle from Intent in Next Activity.

    Also you can add ArrayList into Bundle .

    To use the above do this:

    In 'sending' activity use:

    ArrayList<String> arraylist = new Arraylist<String>();
    Bundle bundle = new Bundle();
    bundle.putStringArrayList("arraylist", arraylist);
    

    In 'receiving' activity use:

    Bundle extras = getIntent().getExtras();
    ArrayList<String> arraylist  = extras.getStringArrayList("arraylist");