-2

I have created an Activity , but when i run it , the log says , X frames skipped, may be main activity doing too much work.

So using fragments for different parts, a good idea or not?

Anas Mehar
  • 2,739
  • 14
  • 25

1 Answers1

0

Fragments are really useful. If you think about it, they are really two activities working together as one cohesive "unit".

Advantages:

  • They are really versatile and give you the ability to make different types of apps and UI.
  • Really easy to implement and low on memory.
  • Reusability and portability

Disadvantages:

  • More code(For example, instantiating a fragment manager, adding the fragment transaction, writing the callbacks of the fragment)
  • Communication between fragments and activities is harder. You would need to deal with a parcelable interface to serialize your objects you wish to pass.

Now your question is too broad to give a meaningful answer, but if you are interested check these links out:

Gaurav Mall
  • 2,372
  • 1
  • 17
  • 33