I am doing Android Application for shopping. I need to display products as grid as well as list like this:

<https://lh6.ggpht.com/Ly21pAbBRIxAzHn2R119a37NexxtjG5RkQJV8vv0IoCywzksIhKNSCkzWikbUnH8bGY=h900-rw>

I don't know how to do this using image button or tabs. Can I change layout of the fragment at runtime? Or I have use 2 different fragments? Please help me.