在Android Studio中使用导航抽屉开发Android应用程序

时间:2015-05-01 07:06:53

标签: android navigation-drawer android-support-library

我正在使用android studio 1.1.0来开发具有导航抽屉活动的应用程序。为了开发这个应用程序我在你的refer this视频中。

当我创建objFragment时,它会自动转换为android.app.Fragment objFragment = null;但在视频中显示为Fragment objFragment = null; 在视频的6.00分钟时,它将placeHolderFragment(position +1)替换为之前创建的objFragment。这样做时我得到以下错误。 enter image description here

如何解决此错误。

1 个答案:

答案 0 :(得分:0)

最后我找到了答案。

我替换

android.app.Fragment objFragment = null

通过

android.support.v4.app.Fragment objFragment = null
所有java类文件中的{p>和import android.app.Fragment; import android.support.v4.app.Fragment;