I have requirement where based on the certain condition only, i need to initialize the array of type class. So i'm trying insert switch statement inside the array of type class as below.
for (int i=0;i <testChildData.size();i++ )
{
switch (testChildData.get(i)) {
SyncPreferenceItem[] syncCategoryList = {
case "VISIT":
new SyncPreferenceItem(R.drawable.sync_visit, R.string.PrefVisits,
SynchronizationManager.SYNC_CATEGORY_TYPE.VISITS);
break;
case "CUSTOMERS":
new SyncPreferenceItem(R.drawable.sync_customer, R.string.Customers,
SynchronizationManager.SYNC_CATEGORY_TYPE.CUSTOMERS);
};
}
}
But i'm getting an error. Could you please point me in the right direction or any other logic for the same. Thank you