0

I am creating an residemenu with dynamic contents. I am receiving Residemenu items from service. Now I want to assign that arraylist as Residemenu main items like Home, New Order etc... I have this arralist

 ArrayList<String> MenuHeadersAL = new ArrayList<String>();

and trying to assign like

for(int i=0; i<MenuHeadersAL.size();i++){
        ResideMenuItem MenuItem = new ResideMenuItem(this,R.drawable.ic_veg,MenuHeadersAL.get(i));
        resideMenu.addMenuItem(MenuItem, ResideMenu.DIRECTION_LEFT);
    }

I have 10 values in arraylist but not getting anything in reside menu. Residemenu is blank.

For This I am not using any adapter. When I use

 itemHome = new ResideMenuItem(this, R.drawable.ic_veg, "Home");
 itemNewOrder = new ResideMenuItem(this, R.drawable.ic_veg, "New Order");

and

 resideMenu.addMenuItem(itemHome, ResideMenu.DIRECTION_LEFT);
 resideMenu.addMenuItem(itemNewOrder, ResideMenu.DIRECTION_LEFT);

Then I am able to see menu option but when I am assigning it dynamically then Reside menu is blank.

Ajit Sharma
  • 411
  • 3
  • 8
  • Post your code here..than we able to help you – Ravindra Kushwaha Mar 10 '16 at 06:57
  • Thanks friends for -ve mark. But can you tell me right way ? – Ajit Sharma Mar 10 '16 at 07:10
  • +1..For your editing..Whenever we ask question here than we have to give full information of the question..can u plz tell me where is your adapter...which you are going to set..Provide more information here...Here SO, there is not enmity of any one..Question or answer which is seems to have some effort than they get the up-vote or down-vote – Ravindra Kushwaha Mar 10 '16 at 07:25
  • Again , i am saying that, provide full information here, plz edit your question again... – Ravindra Kushwaha Mar 10 '16 at 07:30

1 Answers1

0

Done !!! Actually I was assigning arraylist to menuitem just after calling service. So there is service thread executes quite late and menulist item line executes with null arraylist. Thanks....

Ajit Sharma
  • 411
  • 3
  • 8