I'm using android studio 1.1.0 to develop an app with navigation drawer activity. To develop this app I refer this video in you tube.
when I create objFragment
it automatically convert as android.app.Fragment objFragment = null;
But in video it show as Fragment objFragment = null;
At the 6.00 min of the video it replace placeHolderFragment(position +1)
with objFragment
which is created before. When doing this I got the following error.
How can I fixed this error.
Finally I have found the answer.
I replace
android.app.Fragment objFragment = null
by
android.support.v4.app.Fragment objFragment = null
and import android.app.Fragment;
by import android.support.v4.app.Fragment;
in all the java class files.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.