不知道什麼是這裏的問題。以下代碼不起作用。在使用類似的代碼之前,我使用了未決的意圖,但從未遇到過這個問題。請幫助。越來越印刷Android的等待意向與報警管理器不工作
從Main.java日誌報表,但沒有東西從PublicData.class登錄
Main.java
AlarmManager alarm;
long gap = 1800000;
Calendar cal;
Log.d("Stoned", "pending intent about to create");
Intent i = new Intent(this, PublicData.class);
PendingIntent pint = PendingIntent.getService(
this, 0, i, 0);
Log.d("Stoned", "pending intent creating");
alarm = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
alarm.setRepeating(AlarmManager.RTC, cal.getTimeInMillis(),
gap, pint);
Log.d("Stoned", "pending intent created");
PublicData.java
public class PublicData extends IntentService {
@Override
protected void onHandleIntent(Intent intent) {
Log.d("Stoned", "In pending intent");
}
.
.
按照以下步驟1.延伸的BroadcastReceiver 2.使用的onReceive()按照此[鏈接](http://stackoverflow.com/questions/20112247/could-alarmmanager-setinexactrepeating-not-broadcast-intents-when -the-device-is/20112991#20112991) – Saj