나는 AlarmManager를 사용하여 1 분마다 실행되는 서비스를 시작합니다. 그러나, 나는 "응용 프로그램 blabla가 예기치 않게 중단되었습니다." 장치를 켤 때 강제 닫기 버튼이있는 경고 대화 상자. 내가 가진 유일한 디버깅 옵션은 WIFI와 연결의 IP가 장치를 재부팅 할 때마다 변경되기 때문에 오류가 무엇인지 알 수 없습니다.부팅시 Android AlarmManager
서비스가 부팅되지 않고 정상적으로 실행됩니다. 여기
내 브로드 캐스트 리시버는 응용 프로그램에서 실행됩니다 :public class FPBootReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
android.os.Debug.waitForDebugger();
Intent bootintent = new Intent(context, FPService.class);
PendingIntent pi = PendingIntent.getService(context, 0, bootintent, PendingIntent.FLAG_UPDATE_CURRENT);
long nextUpdateTimeMillis = DateUtils.MINUTE_IN_MILLIS;
Time nextUpdateTime = new Time();
nextUpdateTime.set(nextUpdateTimeMillis);
AlarmManager FPAlarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
FPAlarm.setRepeating(AlarmManager.RTC, System.currentTimeMillis(), nextUpdateTimeMillis, pi);
}
}
매니페스트 : 당신은 내가이 잘못하고있는 중이 야 볼 잘못된
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:icon="@drawable/pc"
android:label="@string/app_name" >
<service android:name=".FPService" />
<receiver android:enabled="true" android:name="mypackage.FPBootReceiver"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity
android:name=".CF_Aachen"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
아무것도?
UPDATE :는 부팅을 디버깅 관리와 나는 (2781) AndroidRuntime을 얻고있다 : java.lang.RuntimeException가 : java.lang.ClassNotFoundException가 : mypackage.FPBootReceiver를 로더 dalvik.system에 수신기 mypackage.FPBootReceiver를 인스턴스화 할 수 없습니다 .PathClassLoader
Logcat 출력을 확인 했습니까? –
위에 적어주세요. WIFI 디버깅 및 부팅 할 때마다 IP 주소가 변경되기 때문에 그럴 수 없습니다. 기기를 끄지 않고이 부팅 인 텐트를 보낼 수있는 방법이 있습니까? – Erol
어떻게하면 응용 프로그램을 디버깅 할 수 logcat 출력을 얻을 수 있습니까? – Christine