0

I want to fetch data and show it in grid view which is in Fragment but I am getting error.But when I tried to implement same thing in Activity it is working fine why it is happening so?..

Why things get different when implemented in Activity and Fragment?

Can Anyone tell what is to be changed and where we can get stuck?

Thanks.

1
  • put some code here so that you may get help. what did you try Commented Nov 15, 2013 at 13:22

1 Answer 1

2

Slow down. Fragments are tough to grasp and implement when you just got started. To get a better understanding work yourself through this guide. Also make sure you experiment with this example project. Both link to the official Android Developers site.

EDIT: To get the basic picture, make sure you understand the Activity lifecycle and how this lifecycle connects to the Fragment lifecycle. To save yourself from frustration over getting stuck, watch this video and concentrate on the image at 6:10. If you want your Activity and Fragment objects to communicate smoothly, you will need to know when and where you can make method calls and callbacks. There's plenty of other useful material, just keep on searching.

1
  • 1
    thanks..I will read it so that I cant get more clear.. Commented Nov 15, 2013 at 13:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.