android.content.ActivityNotFoundException:

前端 未结 24 2077
一生所求
一生所求 2020-11-22 10:38

I am getting this exception while I am trying to call an activity from another one. The complete exception is

android.content.ActivityNotFoundExcept

24条回答
  •  無奈伤痛
    2020-11-22 11:27

    I had an ActivityNotFoundException when I implemented the Activity inside another class (as an inner class):

    //... inside the utility class Pref
    public static class Activity extends PreferenceActivity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            addPreferencesFromResource(R.xml.prefs);
        }
    }
    //...
    

    Declared as the following inside the manifest:

    After declaring this as a normal class (public class PrefActicity) and changing manifest accordingly, it worked as usual.

提交回复
热议问题