1. Are you ready for the Galaxy S20? Here is everything we know so far!

Fetching 2 Data Sources

Discussion in 'Android Development' started by GotParty, Nov 27, 2019.

  1. GotParty

    GotParty Lurker
    Thread Starter

    Im trying to make my app display 2 different kinds of array lists on another screen with my getMyIntent(). I need to have 2 Serializables but do I need a different bundle for the second list? How do I display it correctly?

    public void getMyIntent() {
    //Only have 1 intent not 2, 1 intent for one screen
    Intent intent = getIntent();

    Bundle bundle = intent.getBundleExtra("intentExtra");
    Bundle bundleTwo = intent.getBundleExtra("intentExtraTwo");

    Serializable bundleContent = bundle.getSerializable("bundleContent");
    Serializable bundleContentTwo = bundle.getSerializable("bundleContent2");

    DCollection dataCollection = (DCollection) bundleContent;

    accountList = dataCollection.getClientArray();

    for (int i = 0; i < accountList.size(); i++) {
    String strI = String.valueOf(i);
    forAccount.setText(strI);
    }


    CustoCollection custoCollection = (CustoCollection) bundleContent;

    customerList = custoCollection.getPersonArray();

    for (int i = 0; i < customerList.size(); i++) {
    String strI2 = String.valueOf(i);
    forCustomer.setText(strI2);
    }
    }
    }
     


Loading...
Similar Threads - Fetching Data Sources
  1. norweger
    Replies:
    14
    Views:
    368
  2. Buggg
    Replies:
    4
    Views:
    431
  3. Bodestone
    Replies:
    1
    Views:
    318
  4. Skip Stocks
    Replies:
    8
    Views:
    248
  5. rajdeeprockysarker
    Replies:
    0
    Views:
    188
  6. Aseem Chishti
    Replies:
    0
    Views:
    329
  7. Gadepalli Aditya
    Replies:
    1
    Views:
    489
  8. kk63852
    Replies:
    0
    Views:
    439
  9. shalinmehta99
    Replies:
    1
    Views:
    440

Share This Page

Loading...