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);
    }
    }
    }
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...
Similar Threads - Fetching Data Sources
  1. OldGrantonian
    Replies:
    3
    Views:
    186
  2. alex_laco
    Replies:
    4
    Views:
    281
  3. SenTerLaneAve
    Replies:
    7
    Views:
    299
  4. Leo78
    Replies:
    8
    Views:
    482
  5. Paul Mars
    Replies:
    2
    Views:
    529
  6. Antrel
    Replies:
    5
    Views:
    438
  7. nesty6017
    Replies:
    5
    Views:
    541
  8. connorhawke
    Replies:
    1
    Views:
    382
  9. Waxfruit
    Replies:
    0
    Views:
    388
  10. rajdeeprockysarker
    Replies:
    0
    Views:
    593

Share This Page

Loading...