Varshil shah
Varshil shah

Reputation: 268

How to access value of Arraylist in android

I have one Hash-map that returns an ArrayList and stored in another ArrayList now I don't know how to access it. The main issue is I don't know the index number of the hash-map return value.

What I tried.

ArrayList<MenuDetail> mdetail;
HashMap<String,ArrayList<MenuDetail>> RTMenuThemeYellow;
for(int i = 0;i < ResponseString.getRights().length;i++)
{
   mdetail = RTMenuThemeYellow.get(ResponseString.getRights()[i]);
   if(mdetail != null)
   {  
   }
}

Now how do I access the value from the mdetail variable

Upvotes: 0

Views: 213

Answers (1)

johnrao07
johnrao07

Reputation: 6908

How i accessed value from mdetail variable?

mdetail.get(i);

'i' is the index -- in your for loop

Upvotes: 1

Related Questions