• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Fetching 2 Data Sources

GotParty

Lurker
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);
}
}
}
 
Back
Top Bottom