default category fix when ther is not any default category
This commit is contained in:
@@ -557,6 +557,17 @@ public class MainActivity extends BaseActivity {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(defaultCategory == null){
|
||||||
|
for(CategoryModel categoryModel: categoryList){
|
||||||
|
if(categoryModel.getName().trim().toLowerCase().equals("pizza")){
|
||||||
|
defaultCategory = categoryModel;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(defaultCategory == null){
|
||||||
|
defaultCategory = categoryList.get(0);
|
||||||
|
}
|
||||||
return defaultCategory;
|
return defaultCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user