程序崩掉了
04-23 12:17:06.115 24702-24702/com.example.ly.myapplication E/AndroidRuntime: java.lang.RuntimeException: Unable to start receiver com.example.ly.myapplication.NewAppWidget: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.ly.myapplication/com.example.ly.myapplication.Myservice}; have you declared this activity in your AndroidManifest.xml?
04-23 12:17:06.115 24702-24702/com.example.ly.myapplication E/AndroidRuntime: ?Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.ly.myapplication/com.example.ly.myapplication.Myservice}; have you declared this activity in your AndroidManifest.xml?
04-23 12:17:06.115 24702-24702/com.example.ly.myapplication E/AndroidRuntime: ? ? at com.example.ly.myapplication.NewAppWidget.onEnabled(NewAppWidget.java:31)
但是也注冊了啊
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
? ?package="com.example.ly.myapplication" >
? ?<application
? ? ? ?android:allowBackup="true"
? ? ? ?android:icon="@mipmap/ic_launcher"
? ? ? ?android:label="@string/app_name"
? ? ? ?android:supportsRtl="true"
? ? ? ?android:theme="@style/AppTheme" >
? ? ? ?<activity
? ? ? ? ? ?android:name=".MainActivity"
? ? ? ? ? ?android:label="@string/app_name"
? ? ? ? ? ?android:theme="@style/AppTheme.NoActionBar" >
? ? ? ? ? ?<intent-filter>
? ? ? ? ? ? ? ?<action android:name="android.intent.action.MAIN" />
? ? ? ? ? ? ? ?<category android:name="android.intent.category.LAUNCHER" />
? ? ? ? ? ?</intent-filter>
? ? ? ?</activity>
? ? ? ?<service android:name=".Myservice"></service>
? ? ? ?<receiver android:name=".NewAppWidget" >
? ? ? ? ? ?<intent-filter>
? ? ? ? ? ? ? ?<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
? ? ? ? ? ?</intent-filter>
? ? ? ? ? ?<meta-data
? ? ? ? ? ? ? ?android:name="android.appwidget.provider"
? ? ? ? ? ? ? ?android:resource="@xml/new_app_widget_info" />
? ? ? ?</receiver>
? ?</application>
</manifest>
2016-04-24
原來context.startService寫錯了 .... 這提問怎么沒有撤回...