I want to display barchart in full screen after clicking on a button but I got an error when passing BarEntry
class between activities.
android.os.ParcelFormatException: Cannot parcel an Entry with non-parcelable data
my code :
ArrayList<BarEntry> barEntries = new ArrayList<>();
barEntries.clear();
barEntries.add(new BarEntry(0, new float[]{8f, 9f, 10f}, "Jan"));
barEntries.add(new BarEntry(1, new float[]{11f, 9f, 5f}, "Feb"));
barEntries.add(new BarEntry(2, new float[]{8f, 3f, 4f}, "Mar"));
barEntries.add(new BarEntry(3, new float[]{5f, 14f, 2f}, "Apr"));
barEntries.add(new BarEntry(4, new float[]{5f, 2f, 3f}, "May"));
barEntries.add(new BarEntry(5, new float[]{2f, 15f, 6f}, "Jun"));
barEntries.add(new BarEntry(6, new float[]{15f, 2f, 8f}, "Jul"));
barEntries.add(new BarEntry(7, new float[]{4f, 19f, 4f}, "Aug"));
barEntries.add(new BarEntry(8, new float[]{5f, 5f, 5f}, "Sept"));
barEntries.add(new BarEntry(9, new float[]{6f, 6f, 6f}, "Oct"));
barEntries.add(new BarEntry(10, new float[]{8f, 9f, 10f}, "Nov"));
barEntries.add(new BarEntry(11, new float[]{2f, 7f, 7f}, "Dec"));
barEntries.add(new BarEntry(12, new float[]{6f, 2f, 8f}, "Jan"));
Intent bar = new Intent(ChartRevenueActivity.this, FullscreenActivity.class);
Bundle bundle = new Bundle();
bundle.putSerializable("barEntries", barEntries);
bar.putExtra("type", "barChart");
bar.putExtras(bundle);
startActivity(bar);
See Question&Answers more detail:
os