I currently have 4 different buttons. 3 of them lead to the same activity, but populate an ArrayList with different data. The only difference between the different sets of data is the size.
Everytime I use the working button selectCountryAndStateButton
everything works fine. However when I use the getAllFacilitiesButton
the application returns to the previous activity and I get the following in LogCat
02-08 11:56:26.649 22325-22325/? W/System: ClassLoader referenced unknown path: /data/app/com.company.app-1/lib/x86
02-08 11:56:26.668 22325-22325/? I/GMPM: App measurement is starting up, version: 8487
02-08 11:56:26.668 22325-22325/? I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
02-08 11:56:26.791 22325-22336/com.company.app I/art: Background partial concurrent mark sweep GC freed 418(17KB) AllocSpace objects, 0(0B) LOS objects, 40% free, 4MB/7MB, paused 9.593ms total 21.620ms
02-08 11:56:27.097 22325-22359/com.company.app D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
02-08 11:56:27.177 22325-22359/com.company.app I/OpenGLRenderer: Initialized EGL, version 1.4
02-08 11:56:27.187 22325-22359/com.company.app W/EGL_emulation: eglSurfaceAttrib not implemented
02-08 11:56:27.187 22325-22359/com.company.app W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xad7e0960, error=EGL_SUCCESS
Prior to the error, I received the following.
02-08 11:38:41.064 14907-14907/? E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
However I corrected the error by adding google_app_id.xml
to my resources.
Why am I getting a class loader unknown reference problem when the same exact code works with a set of data that is much smaller?
EDIT: 2/8/2016 1:25pm [central]
Found out my messages were filtered. I'm getting the following error:
E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 526172)
Which means my List of 644 objects is too big to pass to the next activity. Will answer with solution
-----Below is my code-----
Working Button (facilities.size() < 100 )
selectCountryAndStateButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ServiceConnector sc = getServiceConnector();
sc.execute(APICallEnum.SEARCH_BY_COUNTRY, countrySelected, stateSelected);
try {
String data = sc.get();
List<Facility> facilities = JSONParser.getFromJson(data);
//Open list activity of facilities
openListActivity(facilities);
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
Button does not work (facilities.size() = 644)
getAllFacilitiesButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.i("Search", "get all");
ServiceConnector sc = getServiceConnector();
sc.execute(APICallEnum.GET_ALL_FACILITIES);
try {
String data = sc.get();
List<Facility> facilities = JSONParser.getFromJson(data);
openListActivity(facilities);
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
Open next Activity code
private void openListActivity(List<Factility> f) {
Intent intent = new Intent(FindLocation.this, ListingActivity.class);
intent.putExtra("facilities", new FacilityList(f));
startActivity(intent);
}