android-pendingintent

    19熱度

    5回答

    我正在開發一個應用程序,向用戶顯示通知。通知的目標是讓用戶在用戶處於其他活動時輕鬆返回活動。我在我的應用程序中使用此代碼來創建並顯示通知。 notification = new Notification(R.drawable.icon, "Notify", System.currentTimeMillis()); notific

    1熱度

    1回答

    所有PendingIntents 可能重複: Android: Get all PendingIntents set with AlarmManager 我期待列出我的應用程序設置的所有未決報警,所以後來我可以爲各個添加一個取消按鈕報警。 問題是,我不知道如何做到這一點,並不知道從哪裏開始。 我將不勝感激任何指向正確的方向。 謝謝。

    0熱度

    1回答

    我有一個報警管理器,它調用一個名爲ScheduleAlert的活動類。 public class ScheduleAlert extends ActivityGroup { private String notificationAlart, editEventid; @Override public void onCreate(Bundle savedInstan

    24熱度

    2回答

    真的不知道如何尋找這個... 我有每當作業被添加或從我的隊列中刪除被稱爲放一個通知在狀態欄下面: private void showNotification() { int jobsize = mJobQueue.size(); int icon = (jobsize == 0) ? android.R.drawable.stat_sys_upload_done

    9熱度

    1回答

    我使用鬧鐘從服務器獲取數據。 我喜歡讓用戶選擇啓動和停止鬧鐘。 這意味着我必須檢查並查看是否已設置警報。 我發現一些代碼,告訴我如果報警已被設置: Intent I = new Intent(getApplicationContext(),AlarmReceiver.class); PendingIntent P = PendingIntent.getBroadcast(getApplicati

    2熱度

    1回答

    可能重複: Android: how to cancel a request of Location update with intent? 我試圖禁用我已經在不同的活動之前創建一個懸而未決的意圖(廣播),但我無法得到它的工作。我讀過我應該重新創建intent(使用相同的extras和所有內容),將它作爲參數傳遞,以便我可以實例化pendingIntent,然後將pendingIntent作爲參數

    0熱度

    2回答

    當設置服務在特定時間關閉時,我使用AlarmManager系統服務。 一切都沒有問題,服務被調用,併發生行動。 當達到鬧鐘時間時,服務啓動,此時我獲得系統時間(System.currentTimeMillis())。我猜這不會是服務開始的實際時間。有沒有辦法獲得爲這個PendingIntent設置的時間? 即 爲上午9時設置報警。 DoStuffService從上午9點開始。 DoStuffSer

    4熱度

    2回答

    如Android開發者指南所述,如果您希望小部件更新頻率更高,您應該使用AlarmManager來設置不喚醒設備的警報。 原則上:不要使用AppWidgetProvider類提供的標準機制,並且可以在xml文件中使用android:updatePeriodMillis輕鬆設置。 我很抱歉問,但指南只是聲明「使用AlarmManager,使用RTC或ELAPSED_REALTIME,...」但我真的

    12熱度

    4回答

    嗨我已經能夠獲取顯示的活動通知,並且當用戶點擊通知時,應用程序將重新啓動。但是我只是希望它重新出現而不是重新啓動。例如。它是一個網絡應用程序,我希望它在用戶選擇通知時到達前端,但不刷新網頁。我能捕捉這個意圖嗎?還是我發送了錯誤的意圖?通常情況下,如果我按主頁按鈕並單擊應用程序圖標,應用程序會出現,並且不會刷新/重新啓動。所以這是我想要的行爲。有任何想法嗎 ? String ns = Context

    2熱度

    1回答

    我試圖每60秒運行一次cpu激烈的任務。我使用AlarmManager用的PendingIntent,` Intent intent = new Intent(MainActivity.this,AlarmReciever.class); PendingIntent pi=PendingIntent.getBroadcast(this, 0, intent, 0); am.se