override fun onResume() {
val actions = arrayOf(MBAPIConstants.ACTION_GET_BLOCKS, MBAPIConstants.ACTION_GET_PROJECT)
bRec = MBurgerApiActionInitializer.initializeNookoReceiverCustom(this, this, actions)
MBurgerTasks.askForProject(this)
/**Add custom filters to the API call or leave it null**/
val arrayOfFilters: ArrayList<Any> = null
/**Inside the blocks returned the “sections” field will be valorized**/
/**Inside the sections the “elements” field will not be valorized (null)**/
MBurgerTasks.askForBlocks(this, arrayOfFilters, getSections, getElements)
MBurgerTasks.askForProject(this)
MBurgerApiActionInitializer.pauseNookoReceiver(this, bRec)
override fun onApiResult(MBAPIResponse response) {
/** Check ApiAction to distinguish the responses**/
if (response.getApiAction().equals(MBAPIConstants.ACTION_GET_BLOCKS)) {
if (response.getResult()) {
blocks = (ArrayList<MBBlock>)response.getPayload().get(MBApiPayloadKeys.key_blocks)
/** Once you received the project’s blocks you can draw your menu**/
Log.e(“ERROR RESPONSE API”, “THERE WAS AN ERROR DURING BLOCKS’ LOADING”)
if(response.getApiAction().equals(MBAPIConstants.ACTION_GET_PROJECT)){
if (response.getResult()) {
project = (MBProject)response.getPayload().get(MBApiPayloadKeys.key_project)
Log.e(“ERROR RESPONSE API”, “THERE WAS AN ERROR DURING BLOCKS’ LOADING”)