Why does Android Account & Sync reboot when trying to find my settings activity?

Posted by mobibob on Stack Overflow See other posts from Stack Overflow or by mobibob
Published on 2011-01-13T20:43:21Z Indexed on 2011/01/14 21:53 UTC
Read the original article Hit count: 441

I have an activity that I can declare as Launcher category and it launches just fine from the home screen. However, when I try to hook-up the same activity into my SyncAdapter's settings activity and open it from the Accounts & Sync page -> MySyncAdapter -> (touch account listing) it aborts with a system fatal error (reboots phone).

Meanwhile, my SyncAdapter is working other respects.

Here is the log at point of impact:

01-13 12:31:00.976  5024  5038 I ActivityManager: Starting activity: Intent { act=android.provider.Settings.ACTION_SYNC_SETTINGS flg=0x10000000 cmp=com.myapp.android.syncadapter.ui/SyncAdapterSettingsActivity.class (has extras) }
01-13 12:31:00.985  5024  5038 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: android.server.ServerThread
01-13 12:31:00.985  5024  5038 E AndroidRuntime: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myapp.android.syncadapter.ui/SyncAdapterSettingsActivity.class}; have you declared this activity in your AndroidManifest.xml?
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.app.ContextImpl.startActivity(ContextImpl.java:622)
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.preference.Preference.performClick(Preference.java:828)
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:190)
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.widget.AdapterView.performItemClick(AdapterView.java:284)
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.widget.ListView.performItemClick(ListView.java:3382)
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:587)
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:92)
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:123)
01-13 12:31:00.985  5024  5038 E AndroidRuntime:    at com.android.server.ServerThread.run(SystemServer.java:517)
01-13 12:31:00.985  5024  5038 I Process : Sending signal. PID: 5024 SIG: 9
01-13 12:31:01.005  5019  5019 I Zygote  : Exit zygote because system server (5024) has terminated
01-13 12:31:01.015  1211  1211 E installd: eof

Here is a snippet from my manifest file:

   <activity android:name="com.myapp.android.syncadapter.ui.SyncAdapterSettingsActivity"
              android:label="@string/title_settings" 
              android:windowSoftInputMode="stateAlwaysHidden|adjustPan">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <action android:name="android.intent.action.MAIN" />
            <action android:name="android.provider.Settings.ACTION_SYNC_SETTINGS"/>
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

© Stack Overflow or respective owner

Related posts about android

Related posts about activity