ClassNotFoundException when the class is there?

点点圈 提交于 2019-12-02 11:09:34

It seems that there is an error in the onCreate of your main activity. Did you provide an onCreate(Bundle savedInstance) if so , try to clear it and see if it works then.

If that does not work, try to use extend Activity instead of extend FrameActivity.

Good luck

From your quition detail i assume that you forgot to declare your FrameActivity into AndroidManifest.xml , kindly check your AndroidManifest.xml file entry.

I think you used the FragmentActivity the wrong way, I guess FragmentActivities should be a part of a normal activity, see below:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">
    <fragment
        android:name="com.mamlambo.tutorial.tutlist.TutListFragment"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:id="@+id/tutlist_fragment"
        android:layout_weight="45">
    </fragment>
    <fragment
        android:name="com.mamlambo.tutorial.tutlist.TutViewerFragment"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:id="@+id/tutview_fragment"
        android:layout_weight="55">
    </fragment>
</LinearLayout>

Taken from this link (part 9)

http://mobile.tutsplus.com/tutorials/android/android-sdk_fragments/

Right click on your project folder => Properties => Java Build Path => Order and Export => check the box "Android Private Libraries" if not checked. Make a clean. And it works !

I got the same problem with MobilTuts sample, problem was with support library. I have changed the build target to a higher API than 10, something like 15 for example, and then all errors vanished.

Project Properties --> Android --> Project Build Target --> Set it to 15 .e.g

Recommendation: set MIN API inside manifest to 8 at lest.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!