Krishna Chaitu Krishna Chaitu - 8 months ago 75
Android Question

Fragments app development

https://www.journaldev.com/9266/android-fragment-lifecycle#comment-39628

iam following the above link to develop fragments in my android app but iam struck in this particular fragment if this error is resolved the app will work fine
can you make me know where i went wrong

enter image description here

enter image description here

added 2nd picture to make to everyone clear that iam facing error when i use getSupportFragmentManager()

check out this screenshot too

enter image description here

Answer Source

There are 2 different types of Fragments:

import android.app.Fragment;
import android.support.v4.app.Fragment;

you have to Use the corresponding FragmentManager for them. Either getFragmentManager() or getSupportFragmentManager();

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download