共用方式為


BroadcastReceiver 類別

定義

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

[Android.Runtime.Register("android/content/BroadcastReceiver", DoNotGenerateAcw=true)]
public abstract class BroadcastReceiver : Java.Lang.Object
[<Android.Runtime.Register("android/content/BroadcastReceiver", DoNotGenerateAcw=true)>]
type BroadcastReceiver = class
    inherit Object
繼承
BroadcastReceiver
衍生
屬性

備註

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

您可以使用 動態方式註冊這個類別Context#registerReceiver Context.registerReceiver()的實例,或以靜態方式在 中AndroidManifest.xml宣告 具有標記的android.R.styleable#AndroidManifestReceiver &lt;receiver&gt;實作。

<div class=“special reference”><h3>Developer Guides</h3>

如需使用 BroadcastReceiver 的詳細資訊,請參閱 Broadcasts 開發人員指南。

</div>

android.content.BroadcastReceiverJava 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

建構函式

BroadcastReceiver()
BroadcastReceiver(IntPtr, JniHandleOwnership)

建立 JNI 物件的 Managed 表示法時使用的建構函式;由運行時間呼叫。

屬性

AbortBroadcast

傳回旗標,指出這個接收者是否應該中止目前的廣播。

Class

傳回這個 Object的運行時間類別。

(繼承來源 Object)
DebugUnregister

傳回提供給 的最後一 #setDebugUnregister個值。 -或- 控制對 的不相符呼叫 Context#registerReceiver(BroadcastReceiver, IntentFilter) Context.registerReceiver()偵錯說明的包含。

Handle

基礎Android實例的句柄。

(繼承來源 Object)
IsInitialStickyBroadcast

如果接收者目前正在處理黏性廣播的初始值,則會傳回 true;也就是說,上次廣播的值,且目前保留在黏性快取中,因此這不是現在廣播的結果。

IsOrderedBroadcast

如果接收者目前正在處理已排序的廣播,則傳回 true。

JniIdentityHashCode

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
JniPeerMembers

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

PeerReference

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
ResultCode

擷取目前的結果碼,如上一個接收者所設定。 -或- 變更此廣播的目前結果碼;僅適用於透過 Context#sendOrderedBroadcast(Intent, String) Context.sendOrderedBroadcast傳送的廣播。

ResultData

擷取目前的結果數據,如先前接收者所設定。 -或- 變更此廣播的目前結果數據;僅適用於透過 Context#sendOrderedBroadcast(Intent, String) Context.sendOrderedBroadcast傳送的廣播。

SentFromPackage

傳回最初傳送此廣播之應用程式的套件名稱。

SentFromUid

傳回最初傳送此廣播之應用程式的 UID。

ThresholdClass

此 API 支援適用於 Android 的 Mono 基礎結構,並不適合直接從您的程式代碼使用。

ThresholdType

此 API 支援適用於 Android 的 Mono 基礎結構,並不適合直接從您的程式代碼使用。

方法

ClearAbortBroadcast()

清除旗標,指出這個接收者應該中止目前的廣播。

Clone()

建立並傳回這個 對象的複本。

(繼承來源 Object)
Dispose()

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
Dispose(Boolean)

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
Equals(Object)

指出其他物件是否「等於」這個物件。

(繼承來源 Object)
GetHashCode()

傳回此物件的雜湊碼值。

(繼承來源 Object)
GetResultExtras(Boolean)

擷取目前的結果額外數據,如先前接收者所設定。

GoAsync()

這可由 中的 #onReceive 應用程式呼叫,以允許它在從該函式傳回之後保持廣播作用中。

InvokeAbortBroadcast()

設定旗標,指出這個接收者應該中止目前的廣播;僅適用於透過 Context#sendOrderedBroadcast(Intent, String) Context.sendOrderedBroadcast傳送的廣播。

JavaFinalize()

當垃圾收集決定不再參考物件時,垃圾收集行程在 物件上呼叫。

(繼承來源 Object)
Notify()

喚醒正在等候此物件監視器的單一線程。

(繼承來源 Object)
NotifyAll()

喚醒正在等候此物件監視器的所有線程。

(繼承來源 Object)
OnReceive(Context, Intent)

當 BroadcastReceiver 收到 Intent 廣播時,會呼叫這個方法。

PeekService(Context, Intent)

將系結器提供給已系結的服務。

SetHandle(IntPtr, JniHandleOwnership)

設定 Handle 屬性。

(繼承來源 Object)
SetOrderedHint(Boolean)

針對內部使用,設定這個 BroadcastReceiver 是否以排序模式執行的相關提示。

SetResult(Result, String, Bundle)

變更從這個廣播傳回的所有結果數據;僅適用於透過 Context#sendOrderedBroadcast(Intent, String) Context.sendOrderedBroadcast傳送的廣播。

SetResultExtras(Bundle)

變更此廣播的目前結果額外專案;僅適用於透過 Context#sendOrderedBroadcast(Intent, String) Context.sendOrderedBroadcast傳送的廣播。

ToArray<T>()

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
ToString()

傳回物件的字串表示。

(繼承來源 Object)
UnregisterFromRuntime()

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
Wait()

讓目前線程等候直到喚醒為止,通常是藉由em <notified/em>或<em>interrupted</em> 來喚醒它。<>

(繼承來源 Object)
Wait(Int64, Int32)

讓目前的線程等到喚醒為止,通常是因為 <em>notified</em> 或 <em>interrupted</em>,或直到經過一定數量的實時為止。

(繼承來源 Object)
Wait(Int64)

讓目前的線程等到喚醒為止,通常是因為 <em>notified</em> 或 <em>interrupted</em>,或直到經過一定數量的實時為止。

(繼承來源 Object)

明確介面實作

IJavaPeerable.Disposed()

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
IJavaPeerable.DisposeUnlessReferenced()

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
IJavaPeerable.Finalized()

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
IJavaPeerable.JniManagedPeerState

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
IJavaPeerable.SetJniIdentityHashCode(Int32)

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates)

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)
IJavaPeerable.SetPeerReference(JniObjectReference)

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

(繼承來源 Object)

擴充方法

JavaCast<TResult>(IJavaObject)

執行 Android 執行時間檢查的類型轉換。

JavaCast<TResult>(IJavaObject)

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

GetJniTypeName(IJavaPeerable)

接收和處理 所 android.content.Context#sendBroadcast(Intent)傳送之廣播意圖的程式代碼基類。

適用於