InCallService 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
此服務由一款應用程式實作,旨在提供管理電話通話的功能。
[Android.Runtime.Register("android/telecom/InCallService", ApiSince=23, DoNotGenerateAcw=true)]
public abstract class InCallService : Android.App.Service
[<Android.Runtime.Register("android/telecom/InCallService", ApiSince=23, DoNotGenerateAcw=true)>]
type InCallService = class
inherit Service
- 繼承
- 屬性
備註
此服務由一款應用程式實作,旨在提供管理電話通話的功能。
<h2>成為預設電話應用程式</h2> 預設撥號器/電話應用程式是在裝置通話中提供通話中使用者介面的應用程式。 它也讓使用者能發起通話並查看裝置上的通話紀錄。 裝置會隨系統預設的撥號器/電話應用程式一起打包。 使用者可選擇單一應用程式來接替系統應用程式的此角色。 想要擔任此職缺的應用程式會利用 來 android.app.role.RoleManager 請求他們填補該 android.app.role.RoleManager#ROLE_DIALER 職位。
預設的手機應用程式會在裝置通話時提供使用者介面,且裝置未進入車載模式(即 UiModeManager#getCurrentModeType() 非 android.content.res.Configuration#UI_MODE_TYPE_CAR)。
為了填補這個 android.app.role.RoleManager#ROLE_DIALER 職位,應用程式必須符合多項條件: <ul><li>它必須處理 Intent#ACTION_DIAL 意圖。 這表示應用程式必須提供撥號鍵盤介面,讓使用者能啟動撥出電話。</li><li>它必須完整實作 InCallService API,並提供來電介面以及持續通話 UI。</li></ul>
注意:如果應用程式在綁定期間填寫 android.app.role.RoleManager#ROLE_DIALER 回報 nullInCallService ,電信框架會自動回退到使用裝置預先載入的撥號器應用程式。 系統會顯示通知,告知使用者已透過預載的撥號應用程式繼續通話。 你的應用程式絕不應該回傳綁定;若回傳 null ,則表示不 android.app.role.RoleManager#ROLE_DIALER符合 。
注意:如果你的應用程式在執行時填 android.app.role.RoleManager#ROLE_DIALER 滿並做出變更,導致不再符合此角色的要求, android.app.role.RoleManager 將自動將你的應用程式從角色中移除並關閉。 例如,如果你用android.content.pm.PackageManager#setComponentEnabledSetting(ComponentName, int, int)程式方式停用InCallService應用程式在清單中宣告的設定,你的應用程式將不再符合 。android.app.role.RoleManager#ROLE_DIALER
預設的撥號器在使用者撥打緊急電話時一定會被使用,即使你的應用程式已經接替了這個 android.app.role.RoleManager#ROLE_DIALER 角色。 為了確保撥打緊急電話時有最佳體驗,預設撥號器應該始終使用 android.telecom.TelecomManager#placeCall(Uri, Bundle) 來撥打電話(包括緊急電話)。 這確保平台能驗證請求是否來自預設撥號器。 若非預載撥號應用程式撥 Intent#ACTION_CALL 打緊急電話,則會被轉至已 Intent#ACTION_DIAL 預載的撥號應用程式進行確認;這是不理想的使用者體驗。
以下是一個 InCallService. 元資料 TelecomManager#METADATA_IN_CALL_SERVICE_UI 顯示此實 InCallService 作意圖取代內建的通話使用者介面。 元資料 TelecomManager#METADATA_IN_CALL_SERVICE_RINGING 顯示這 InCallService 會播放來電鈴聲。 請參考下方,了解如何在應用程式中顯示來電介面及播放鈴聲。
{@code
<service android:name="your.package.YourInCallServiceImplementation"
android:permission="android.permission.BIND_INCALL_SERVICE"
android:exported="true">
<meta-data android:name="android.telecom.IN_CALL_SERVICE_UI" android:value="true" />
<meta-data android:name="android.telecom.IN_CALL_SERVICE_RINGING"
android:value="true" />
<intent-filter>
<action android:name="android.telecom.InCallService"/>
</intent-filter>
</service>
}
<em>注意:您不應將 your InCallService 標記為屬性 android:exported="false";如此一來可能會導致在呼叫時無法綁定到您的實作。</em>
除了實作 InCallService API,你還必須在 manifest 中宣告一個活動來處理意圖。Intent#ACTION_DIAL 以下範例說明了如何做到:
{@code
<activity android:name="your.package.YourDialerActivity"
android:label="@string/yourDialerActivityLabel">
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
</activity>
}
當使用者安裝並首次執行應用程式時,你應該用 來 android.app.role.RoleManager 提示使用者是否希望你的應用程式成為新的預設手機應用程式。
以下代碼顯示您的應用程式如何申請成為預設電話/撥號應用程式:
{@code
private static final int REQUEST_ID = 1;
public void requestRole() {
RoleManager roleManager = (RoleManager) getSystemService(ROLE_SERVICE);
Intent intent = roleManager.createRequestRoleIntent(RoleManager.ROLE_DIALER);
startActivityForResult(intent, REQUEST_ID);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_ID) {
if (resultCode == android.app.Activity.RESULT_OK) {
// Your app is now the default dialer app
} else {
// Your app is not the default dialer app
}
}
}
}
<h3>穿戴式裝置< InCallService 存取/h3><ol> 如果您的應用程式是第三方配套應用程式,且想存取 InCallService API,您的應用程式可以做以下功能:
<ol><li> 在你的清單 <中宣告MANAGE_ONGOING_CALLS權限 li> 透過 android.companion.CompanionDeviceManager API 與實體穿戴裝置作為伴侶應用程式關聯。 參見: https://developer.android.com/guide/topics/connectivity/companion-device-pairing<li> 實作此 InCallService 並取得 BIND_INCALL_SERVICE 權限 </ol></ol>
</pre>
<h3>顯示來電通知</h3> 當您的應用程式透過 接收到新的來電 InCallService#onCallAdded(Call)時,它負責為該來電顯示來電的來電介面。 它應該會用 android.app.NotificationManager API 來發布新的來電通知來達成。
當你的應用程式宣告元資料 TelecomManager#METADATA_IN_CALL_SERVICE_RINGING時,它負責播放來電的鈴聲。 你的應用程式應該會建立 android.app.NotificationChannel 一個指定想要鈴聲的應用程式。 例如:
<code>
NotificationChannel channel = new NotificationChannel(YOUR_CHANNEL_ID, "Incoming Calls",
NotificationManager.IMPORTANCE_MAX);
// other channel setup stuff goes here.
// We'll use the default system ringtone for our incoming call notification channel. You can
// use your own audio resource here.
Uri ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
channel.setSound(ringtoneUri, new AudioAttributes.Builder()
// Setting the AudioAttributes is important as it identifies the purpose of your
// notification sound.
.setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.build());
NotificationManager mgr = getSystemService(NotificationManager.class);
mgr.createNotificationChannel(channel);
</code>
當你的應用程式接到新來電時,會為該來電建立一個 android.app.Notification ,並將其與你的來電通知頻道關聯。 你可以在通知中指定 a android.app.PendingIntent ,這樣就能啟動全螢幕的來電來電介面。 通知管理員框架會在使用者正在使用手機時,以提醒通知的形式顯示。 當使用者不使用手機時,會使用全螢幕的來電介面。 例如:
<code>{@code
// Create an intent which triggers your fullscreen incoming call user interface.
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClass(context, YourIncomingCallActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 1, intent, PendingIntent.FLAG_MUTABLE_UNAUDITED);
// Build the notification as an ongoing high priority item; this ensures it will show as
// a heads up notification which slides down over top of the current content.
final Notification.Builder builder = new Notification.Builder(context);
builder.setOngoing(true);
builder.setPriority(Notification.PRIORITY_HIGH);
// Set notification content intent to take user to the fullscreen UI if user taps on the
// notification body.
builder.setContentIntent(pendingIntent);
// Set full screen intent to trigger display of the fullscreen UI when the notification
// manager deems it appropriate.
builder.setFullScreenIntent(pendingIntent, true);
// Setup notification content.
builder.setSmallIcon( yourIconResourceId );
builder.setContentTitle("Your notification title");
builder.setContentText("Your notification content.");
// Use builder.addAction(..) to add buttons to answer or reject the call.
NotificationManager notificationManager = mContext.getSystemService(
NotificationManager.class);
notificationManager.notify(YOUR_CHANNEL_ID, YOUR_TAG, YOUR_ID, builder.build());
}
Java 文件 android.telecom.InCallService。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
建構函式
| 名稱 | Description |
|---|---|
| InCallService() |
初始化呼叫中介面的基礎服務。 |
| InCallService(IntPtr, JniHandleOwnership) |
建立一個受管理實例,代表一個現有的 Java 物件。 |
欄位
| 名稱 | Description |
|---|---|
| AccessibilityService |
使用 with |
| AccountService |
使用 with |
| ActivityService |
使用 來 |
| AdvancedProtectionService |
使用 以 |
| AlarmService |
使用 with |
| AppFunctionService |
用 來 |
| AppInteractionService |
用 with |
| AppOpsService |
使用 with |
| AppSearchService |
用 來 |
| AppwidgetService |
使用 with |
| AudioService |
使用來 |
| AuthenticationPolicyService |
使用 以 |
| AutofillService |
使用 以 |
| BatteryService |
用 來 |
| BindAllowActivityStarts |
已淘汰.
標記 |
| BindExternalServiceLong |
其運作方式與 相同 |
| BindNotPerceptible |
已淘汰.
標記: |
| BindPackageIsolatedProcess |
已淘汰.
標記 |
| BindSharedIsolatedProcess |
已淘汰.
標記為 |
| BiometricService |
用 with |
| BlobStoreService |
使用 with |
| BluetoothService |
用 來 |
| BugreportService |
服務用來擷取錯誤報告。 (繼承來源 Context) |
| CameraService |
用 來 |
| CaptioningService |
使用 with |
| CarrierConfigService |
使用 來 |
| ChooserService |
使用 with |
| ClipboardService |
使用 with |
| CompanionDeviceService |
使用 with |
| ConnectivityDiagnosticsService |
使用來 |
| ConnectivityService |
使用 with |
| ConsumerIrService |
使用時 |
| ContactKeysService |
使用來 |
| ContentRestrictionService |
使用 with |
| CredentialService |
使用 with |
| CrossProfileAppsService |
使用 with |
| DeviceIdDefault |
預設裝置 ID,即主要(非虛擬)裝置的 ID。 (繼承來源 Context) |
| DeviceIdInvalid |
裝置 ID 無效。 (繼承來源 Context) |
| DeviceLockService |
使用 with |
| DevicePolicyService |
使用 with |
| DisplayHashService |
使用 to |
| DisplayService |
使用 with |
| DomainVerificationService |
使用 to |
| DownloadService |
使用 with |
| DropboxService |
用 來 |
| EuiccService |
用 來 |
| FileIntegrityService |
使用 以 |
| FileService |
使用 with |
| FingerprintService |
使用來 |
| GameService |
使用 with |
| GrammaticalInflectionService |
使用 with |
| HardwarePropertiesService |
使用 with |
| HealthconnectService |
使用 with |
| HidService |
使用 with |
| InputMethodService |
使用 with |
| InputService |
使用 來 |
| IpsecService |
使用 with |
| JobSchedulerService |
用 with |
| KeychainService |
使用 with |
| KeyguardService |
用 來 |
| KeystoreService |
使用 with |
| LauncherAppsService |
使用 with |
| LayoutInflaterService |
在此語境下,使用 with |
| LocaleService |
使用 with |
| LocationService |
使用 with |
| MediaCommunicationService |
使用 來 |
| MediaMetricsService |
使用 with |
| MediaProjectionService |
使用 with |
| MediaQualityService |
使用 with |
| MediaRouterService |
使用 with |
| MediaSessionService |
使用 with |
| MemoryBudgetService |
用 來 |
| MidiService |
使用 with |
| MultisensoryManagerService |
用來 |
| NetworkStatsService |
用 來 |
| NfcService |
使用 with |
| NotificationService |
使用 with |
| NpuService |
使用 with |
| NsdService |
使用 with |
| OverlayService |
用 來 |
| PccSandboxService |
使用 with |
| PeopleService |
使用 with |
| PerformanceHintService |
使用 來 |
| PersistentDataBlockService |
用 來 |
| PowerService |
用 來 |
| PrintService |
|
| ProfilingService |
使用 以 |
| ReceiverExported |
已淘汰.
標記: |
| ReceiverNotExported |
已淘汰.
標記 |
| ReceiverVisibleToInstantApps |
已淘汰.
標記: |
| RestrictionsService |
使用 with |
| RoleService |
使用 with |
| SatelliteService |
使用 with |
| SearchService |
使用 with |
| SecurityStateService |
使用 with |
| SensorService |
用 來 |
| SerialService |
用 來 |
| ServiceInterface |
|
| ShortcutService |
用 with |
| StatusBarService |
用 來 |
| StopForegroundDetach |
已淘汰.
選取器 |
| StopForegroundLegacy |
的 |
| StopForegroundRemove |
已淘汰.
的 |
| StorageService |
使用 來 |
| StorageStatsService |
使用 with |
| SystemHealthService |
用 來 |
| TelecomService |
使用 with |
| TelephonyImsService |
使用 以 |
| TelephonyPhoneNumberService |
使用 with |
| TelephonyService |
使用 來 |
| TelephonySubscriptionService |
使用 with |
| TetheringService |
使用 with |
| TextClassificationService |
使用 with |
| TextServicesManagerService |
使用 with |
| TimeManagerService |
使用 with |
| TvAdService |
使用 with |
| TvInputService |
用 來 |
| TvInteractiveAppService |
使用 with |
| UiModeService |
用 來 |
| UsageStatsService |
用 來 |
| UsbService |
用 來 |
| UserService |
使用 with |
| VibratorManagerService |
使用來 |
| VibratorService |
使用來 |
| VirtualDeviceService |
使用 with |
| VpnManagementService |
使用 with |
| WallpaperService |
用 with |
| WebAppService |
使用 with |
| WifiAwareService |
使用 with |
| WifiP2pService |
使用 with |
| WifiRttRangingService |
用 with |
| WifiService |
使用 with |
| WindowService |
使用 with |
屬性
| 名稱 | Description |
|---|---|
| Application |
回傳擁有這項服務的應用程式。 (繼承來源 Service) |
| ApplicationContext |
回傳目前程序單一全域應用程式物件的上下文。 (繼承來源 ContextWrapper) |
| ApplicationInfo |
請回傳本情境套件的完整應用程式資訊。 (繼承來源 ContextWrapper) |
| Assets |
回傳一個 AssetManager 實例,針對你的應用程式套件。 (繼承來源 ContextWrapper) |
| AttributionSource |
取得與此情境相關的歸屬來源。 (繼承來源 Context) |
| AttributionTag |
歸因可以在複雜的應用程式中用來邏輯地區分應用程式的各個部分。 (繼承來源 Context) |
| BaseContext |
會取得這個包裝器委派其操作的上下文。 (繼承來源 ContextWrapper) |
| CacheDir |
回傳檔案系統中應用程式專屬快取目錄的絕對路徑。 (繼承來源 ContextWrapper) |
| CallAudioState |
取得目前通話音訊狀態。 |
| Calls |
取得此待命服務將顯示的當前 s 清單 |
| Class |
回傳此 |
| ClassLoader |
回傳一個你可以用來擷取這個套件裡的類別載入器。 (繼承來源 ContextWrapper) |
| CodeCacheDir |
回傳用於儲存快取程式碼的檔案系統中應用程式專屬快取目錄的絕對路徑。 (繼承來源 ContextWrapper) |
| ContentResolver |
回傳一個 ContentResolver 實例,針對你的應用程式套件。 (繼承來源 ContextWrapper) |
| CurrentCallEndpoint |
取得目前的 CallEndpoint。 |
| DataDir |
回傳檔案系統中存放所有屬於此應用程式的私有檔案的目錄的絕對路徑。 (繼承來源 ContextWrapper) |
| DeviceId |
會取得該上下文所關聯的裝置 ID。 (繼承來源 Context) |
| Display |
取得這個情境所關聯的顯示。 (繼承來源 Context) |
| ExternalCacheDir |
回傳主要外部檔案系統目錄的絕對路徑(該目錄位於 ExternalStorageDirectory 應用程式可放置快取檔案的位置)。 (繼承來源 ContextWrapper) |
| FilesDir |
回傳檔案系統中存放檔案 OpenFileOutput(String, FileCreationMode) 的目錄的絕對路徑。 (繼承來源 ContextWrapper) |
| ForegroundServiceType |
如果服務已透過呼叫成為前景服務
|
| Handle |
底層 Android 實例的帳號。 (繼承來源 Object) |
| IsDeviceProtectedStorage |
表示此上下文的儲存 API 是否由裝置保護儲存所支援。 (繼承來源 ContextWrapper) |
| IsRestricted |
表示此上下文是否受限。 (繼承來源 Context) |
| IsUiContext |
如果上下文是可存取 、 或 |
| JniIdentityHashCode |
取得由互通執行時指派給此 Java 對等端的身份雜湊碼。 (繼承來源 Object) |
| JniManagedPeerState |
取得執行時最後指派的狀態旗標。 (繼承來源 JavaObject) |
| JniPeerMembers |
取得用於存取此 Java 綁定成員的 JNI 元資料。 |
| MainExecutor |
回傳 和 |
| MainLooper |
回傳當前程序主執行緒的 Looper。 (繼承來源 ContextWrapper) |
| NoBackupFilesDir |
回傳檔案系統目錄的絕對路徑,類似 FilesDir。 (繼承來源 ContextWrapper) |
| ObbDir |
回傳該應用程式的 OBB 檔案(若有)可找到的主要外部儲存目錄。 (繼承來源 ContextWrapper) |
| OpPackageName |
回傳這個上下文中應該用於 |
| PackageCodePath |
回傳完整路徑至此情境的主要 Android 套件。 (繼承來源 ContextWrapper) |
| PackageManager |
回傳 PackageManager 實例以查找全域套件資訊。 (繼承來源 ContextWrapper) |
| PackageName |
回傳這個應用程式的套件名稱。 (繼承來源 ContextWrapper) |
| PackageResourcePath |
回傳完整路徑至此情境的主要 Android 套件。 (繼承來源 ContextWrapper) |
| Params |
回傳該上下文所用的參數集合,若是透過 |
| PeerReference |
取得這個 Java 節點的 JNI 物件參考。 (繼承來源 Object) |
| Resources |
回傳一個應用程式套件的 Resources 實例。 (繼承來源 ContextWrapper) |
| Theme |
回傳與此上下文相關的主題物件。 (繼承來源 ContextWrapper) |
| ThresholdClass |
取得用於虛擬方法派遣的 Java 類別。 |
| ThresholdType |
取得宣告這個 Java 綁定的受管理型別。 |
| UpdateableFlags |
取得可更新(即新增或移除)現有連線的綁定標誌清單。 (繼承來源 Context) |
| Wallpaper |
已淘汰.
從基礎上下文的舊有壁紙 API 中取得可繪製的壁紙。 (繼承來源 ContextWrapper) |
| WallpaperDesiredMinimumHeight |
已淘汰.
從基底上下文中取得所需的最低壁紙高度。 (繼承來源 ContextWrapper) |
| WallpaperDesiredMinimumWidth |
已淘汰.
從基礎上下文中取得所需的最小壁紙寬度。 (繼承來源 ContextWrapper) |
方法
| 名稱 | Description |
|---|---|
| AttachBaseContext(Context) |
為這個 ContextWrapper 設定基礎上下文。 (繼承來源 ContextWrapper) |
| BindIsolatedService(Intent, Context+BindServiceFlags, String, IExecutor, IServiceConnection) |
請參考 bindIsolatedService(Intent, int, String, Executor, ServiceConnection) 呼叫 BindServiceFlags.of(long) 以取得 BindServiceFlags 物件。 (繼承來源 Context) |
| BindIsolatedService(Intent, Int32, String, IExecutor, IServiceConnection) |
在孤立服務的特定情況下,這種變化 |
| BindService(Intent, Bind, IExecutor, IServiceConnection) |
和 |
| BindService(Intent, Context+BindServiceFlags, IExecutor, IServiceConnection) |
請參見 bindService(Intent, int, Executor, ServiceConnection) 呼叫 BindServiceFlags.of(long) 以取得 BindServiceFlags 物件。 (繼承來源 Context) |
| BindService(Intent, IServiceConnection, Bind) |
連接應用程式服務,必要時建立它。 (繼承來源 ContextWrapper) |
| BindService(Intent, IServiceConnection, Context+BindServiceFlags) |
請參見 bindService(Intent, ServiceConnection, int) 呼叫 BindServiceFlags.of(long) 以取得 BindServiceFlags 物件。 (繼承來源 Context) |
| BindServiceAsUser(Intent, IServiceConnection, Context+BindServiceFlags, UserHandle) |
請參考 bindServiceAsUser(Intent, ServiceConnection, int, UserHandle) 呼叫 BindServiceFlags.of(long) 以取得 BindServiceFlags 物件。 (繼承來源 Context) |
| BindServiceAsUser(Intent, IServiceConnection, Int32, UserHandle) |
以與 相同的方式 |
| CanAddCall() |
如果裝置能支援額外通話,則會退貨。 |
| CheckCallingOrSelfPermission(String) |
確認是IPC的通話流程 還是您 獲得了特定權限。 (繼承來源 ContextWrapper) |
| CheckCallingOrSelfUriPermission(Uri, ActivityFlags) |
確認 IPC 的通話流程或 您 是否已獲得存取特定 URI 的權限。 (繼承來源 ContextWrapper) |
| CheckCallingOrSelfUriPermissions(IList<Uri>, Int32) |
判斷呼叫 IPC 的程序或 您 是否已獲授權存取 URI 清單。 (繼承來源 Context) |
| CheckCallingPermission(String) |
確認你所處理的 IPC 的通話流程是否已獲得特定權限。 (繼承來源 ContextWrapper) |
| CheckCallingUriPermission(Uri, ActivityFlags) |
確認呼叫程序及使用者 ID 是否已獲得存取特定 URI 的權限。 (繼承來源 ContextWrapper) |
| CheckCallingUriPermissions(IList<Uri>, Int32) |
確認呼叫程序與 UID 是否已獲得存取 URI 清單的權限。 (繼承來源 Context) |
| CheckContentUriPermissionFull(Uri, Int32, Int32, ActivityFlags) |
確認某個程序和 UID 是否已被授權存取特定內容 URI。 (繼承來源 Context) |
| CheckPermission(String, Int32, Int32) |
判斷該權限是否允許用於系統中執行的特定程序及使用者 ID。 (繼承來源 ContextWrapper) |
| CheckSelfPermission(String) |
確認您是否已獲得特定許可。 (繼承來源 ContextWrapper) |
| CheckUriPermission(Uri, Int32, Int32, ActivityFlags) |
判斷特定程序及使用者 ID 是否已被授權存取特定 URI。 (繼承來源 ContextWrapper) |
| CheckUriPermission(Uri, String, String, Int32, Int32, ActivityFlags) |
檢查 Uri 和一般權限。 (繼承來源 ContextWrapper) |
| CheckUriPermissions(IList<Uri>, Int32, Int32, Int32) |
確認某個程序與 UID 是否已被授權存取 URI 清單。 (繼承來源 Context) |
| ClearWallpaper() |
已淘汰.
將舊有壁紙清除操作委派給基層上下文。 (繼承來源 ContextWrapper) |
| Clone() |
建立並回傳此物件的副本。 (繼承來源 Object) |
| Construct(JniObjectReference, JniObjectReferenceOptions) |
將此對等節點的建置委派給執行時的值管理器。 (繼承來源 JavaObject) |
| CreateAttributionContext(String) |
回傳一個新的 Context 物件,針對目前的 Context,但屬性是不同的標籤。 (繼承來源 Context) |
| CreateConfigurationContext(Configuration) |
回傳一個新的 Context 物件,針對目前的 Context,但其資源會調整以符合給定的配置。 (繼承來源 ContextWrapper) |
| CreateContext(ContextParams) |
建立具有特定屬性與行為的情境。 (繼承來源 Context) |
| CreateContextForSplit(String) |
為該分割名稱回傳一個新的 Context 物件。 新的 Context 有一個 ClassLoader 和 Resources 物件,可以存取分割及其所有相依關係的程式碼/資源。 每次呼叫此方法都會回傳一個新的上下文物件實例;上下文物件不會被共享,但共用狀態(如 ClassLoader 或其他資源)可能會共享,因此上下文本身可以相當輕量。 (繼承來源 ContextWrapper) |
| CreateDeviceContext(Int32) |
從目前上下文回傳一個新 |
| CreateDeviceProtectedStorageContext() |
回傳一個新的上下文物件,用於目前上下文,但其儲存 API 由裝置保護儲存所支援。 (繼承來源 ContextWrapper) |
| CreateDisplayContext(Display) |
回傳一個新的上下文物件,用於當前上下文,但其資源調整以符合該顯示的指標。 (繼承來源 ContextWrapper) |
| CreatePackageContext(String, PackageContextFlags) |
為給定的應用程式名稱回傳一個新的 Context 物件。 (繼承來源 ContextWrapper) |
| CreateWindowContext(Display, Int32, Bundle) |
為給定 |
| CreateWindowContext(Int32, Bundle) |
為非活動視窗建立一個上下文。 (繼承來源 Context) |
| DatabaseList() |
回傳一組字串,標示與此上下文應用程式套件相關的私有資料庫。 (繼承來源 ContextWrapper) |
| DeleteDatabase(String) |
刪除與此上下文應用程式套件相關的現有私有 SQLiteDatabase。 (繼承來源 ContextWrapper) |
| DeleteFile(String) |
刪除與此上下文應用程式套件相關的指定私有檔案。 (繼承來源 ContextWrapper) |
| DeleteSharedPreferences(String) |
刪除一個現有的共享偏好設定檔案。 (繼承來源 ContextWrapper) |
| Dispose() |
釋放該 Java 節點所持有的資源。 (繼承來源 Object) |
| Dispose(Boolean) |
為子職業提供處理鉤子。 此實作不會執行任何動作。 (繼承來源 Object) |
| DisposeUnlessReferenced() |
請求值管理器處置此對等節點,除非其映射保留該受管理實例。 (繼承來源 JavaObject) |
| Dump(FileDescriptor, PrintWriter, String[]) |
將服務狀態印入給定的串流中。 (繼承來源 Service) |
| EnforceCallingOrSelfPermission(String, String) |
如果你或你正在處理的 IPC 呼叫程序都沒有獲得特定權限,請拋出 SecurityException。 (繼承來源 ContextWrapper) |
| EnforceCallingOrSelfUriPermission(Uri, ActivityFlags, String) |
如果 IPC 或 你的 呼叫程序尚未被授權存取特定 URI,請拋出 SecurityException。 (繼承來源 ContextWrapper) |
| EnforceCallingPermission(String, String) |
如果你正在處理的 IPC 呼叫程序尚未獲得特定權限,請拋出 SecurityException。 (繼承來源 ContextWrapper) |
| EnforceCallingUriPermission(Uri, ActivityFlags, String) |
如果呼叫程序和使用者 ID 尚未被授權存取特定 URI,請拋出 SecurityException。 (繼承來源 ContextWrapper) |
| EnforcePermission(String, Int32, Int32, String) |
如果系統中執行的特定程序和使用者 ID 不允許該權限,請拋出 SecurityException。 (繼承來源 ContextWrapper) |
| EnforceUriPermission(Uri, Int32, Int32, ActivityFlags, String) |
如果某個程序和使用者 ID 尚未被授權存取特定 URI,請拋出 SecurityException。 (繼承來源 ContextWrapper) |
| EnforceUriPermission(Uri, String, String, Int32, Int32, ActivityFlags, String) |
同時執行 Uri 和一般授權。 (繼承來源 ContextWrapper) |
| Equals(Object) |
測試另一個受管理節點是否參考相同的 Java 物件。 (繼承來源 JavaObject) |
| Equals(Object) |
表示是否有其他物體「等同」於此物。 (繼承來源 Object) |
| FileList() |
回傳一個字串陣列,命名與該上下文應用套件相關的私有檔案。 (繼承來源 ContextWrapper) |
| GetColor(Int32) |
回傳與特定資源 ID 相關且依當前主題設計的顏色。 (繼承來源 Context) |
| GetColorStateList(Int32) |
回傳與特定資源 ID 相關聯的色彩狀態清單,並依當前主題做樣式。 (繼承來源 Context) |
| GetDatabasePath(String) |
回傳檔案系統中以 openOrCreateDatabase(String, int, CursorFactory) 建立資料庫的絕對路徑。 若呼叫應用程式移至已採用的儲存裝置,回傳路徑可能會隨時間改變,因此僅應保留相對路徑。 (繼承來源 ContextWrapper) |
| GetDir(String, FileCreationMode) |
擷取並建立一個新的目錄,應用程式可以放置自己的自訂資料檔案。 (繼承來源 ContextWrapper) |
| GetDrawable(Int32) |
回傳一個可繪製的物件,與特定資源 ID 相關聯,並依當前主題做樣式。 (繼承來源 Context) |
| GetExternalCacheDirs() |
回傳所有外部儲存裝置上應用程式專屬目錄的絕對路徑,該應用程式可放置其擁有的快取檔案。 (繼承來源 ContextWrapper) |
| GetExternalFilesDir(String) |
回傳主外部檔案系統目錄的絕對路徑(該 ExternalStorageDirectory位址位於 ),該應用程式可放置其擁有的持久檔案。 (繼承來源 ContextWrapper) |
| GetExternalFilesDirs(String) |
回傳所有外部儲存裝置上應用程式專屬目錄的絕對路徑,該應用程式可放置其擁有的持久檔案。 (繼承來源 ContextWrapper) |
| GetExternalMediaDirs() |
已淘汰.
回傳所有外部儲存裝置上應用程式專屬目錄的絕對路徑,該應用程式可在此放置媒體檔案。 (繼承來源 ContextWrapper) |
| GetFileStreamPath(String) |
回傳檔案系統中建立檔案的絕對路徑,該檔案存放於該 OpenFileOutput(String, FileCreationMode) 檔案中。 (繼承來源 ContextWrapper) |
| GetHashCode() |
回傳物件的雜湊碼值。 (繼承來源 Object) |
| GetObbDirs() |
回傳所有外部儲存裝置上應用程式專屬目錄的絕對路徑,該目錄中可找到應用程式的 OBB 檔案(若有)。 (繼承來源 ContextWrapper) |
| GetSharedPreferences(String, FileCreationMode) |
取回並保留偏好設定檔「名稱」的內容,回傳一個 SharedPreferences,透過它你可以取回並修改其值。 (繼承來源 ContextWrapper) |
| GetString(Int32, Object[]) |
回傳應用程式套件預設字串表中的本地化字串。 (繼承來源 Context) |
| GetString(Int32) |
回傳應用程式套件預設字串表中的本地化字串。 (繼承來源 Context) |
| GetSystemService(Class) |
依類別將句柄回傳至系統層級服務。 (繼承來源 Context) |
| GetSystemService(String) |
以名稱將句柄回傳給系統層級服務。 (繼承來源 ContextWrapper) |
| GetSystemServiceName(Class) |
取得由指定類別所代表的系統層級服務名稱。 (繼承來源 ContextWrapper) |
| GetText(Int32) |
從應用程式套件預設字串表回傳一個本地化且有樣式的 CharSequence。 (繼承來源 Context) |
| GetTextFormatted(Int32) |
從應用程式套件預設字串表回傳一個本地化且有樣式的 CharSequence。 (繼承來源 Context) |
| GrantUriPermission(String, Uri, ActivityFlags) |
將特定 Uri 存取權限授予另一個套件,不論該套件是否擁有存取該 Uri 內容提供者的一般權限。 (繼承來源 ContextWrapper) |
| JavaFinalize() |
已淘汰.
當垃圾回收判定該物件不再有相關參考時,由垃圾回收器呼叫。 (繼承來源 Object) |
| MoveDatabaseFrom(Context, String) |
將現有的資料庫檔案從給定的來源儲存上下文移動到這個上下文。 這通常用於升級後的資料在儲存位置間的遷移,例如遷移到裝置保護儲存裝置。 資料庫必須關閉後才能移動。 (繼承來源 ContextWrapper) |
| MoveSharedPreferencesFrom(Context, String) |
將現有的共享偏好設定檔案從給定的來源儲存上下文移到這個上下文。 這通常用於升級後的資料在儲存位置間的遷移,例如移動到裝置保護儲存裝置。 (繼承來源 ContextWrapper) |
| Notify() |
喚醒一個正在該物件監視器上等待的執行緒。 (繼承來源 Object) |
| NotifyAll() |
喚醒所有等待該物件監視器的執行緒。 (繼承來源 Object) |
| ObtainStyledAttributes(IAttributeSet, Int32[], Int32, Int32) |
在此上下文主題中檢索樣式屬性資訊。 (繼承來源 Context) |
| ObtainStyledAttributes(IAttributeSet, Int32[]) |
在此上下文主題中檢索樣式屬性資訊。 (繼承來源 Context) |
| ObtainStyledAttributes(Int32, Int32[]) |
在此上下文主題中檢索樣式屬性資訊。 (繼承來源 Context) |
| ObtainStyledAttributes(Int32[]) |
在此上下文主題中檢索樣式屬性資訊。 (繼承來源 Context) |
| OnAvailableCallEndpointsChanged(IList<CallEndpoint>) |
當可用的 CallEndpoint 變更時呼叫。 |
| OnBind(Intent) |
把通訊頻道還給服務單位。 |
| OnBringToForeground(Boolean) |
被打電話來把通話畫面移到前景。 |
| OnCallAdded(Call) |
當 a |
| OnCallAudioStateChanged(CallAudioState) |
當音訊狀態改變時會被呼叫。 |
| OnCallEndpointChanged(CallEndpoint) |
當目前的 CallEndpoint 變更時會被呼叫。 |
| OnCallEndpointRequested(CallEndpoint) |
當 a |
| OnCallRemoved(Call) |
當 a |
| OnCanAddCallChanged(Boolean) |
當新增通話功能改變時會被打電話。 |
| OnConfigurationChanged(Configuration) |
當裝置設定變更時,系統會呼叫它,而你的元件正在運行。 (繼承來源 Service) |
| OnConnectionEvent(Call, String, Bundle) |
未上場;為了處理由 A |
| OnCreate() |
系統在服務創建時呼叫。 (繼承來源 Service) |
| OnDestroy() |
系統會打電話通知服務該服務已不再使用並被移除。 (繼承來源 Service) |
| OnLowMemory() |
當整體系統記憶體不足時,當正在執行的程序應該會修剪記憶體使用時,就會呼叫這個動作。 (繼承來源 Service) |
| OnMuteStateChanged(Boolean) |
靜音狀態改變時會被呼叫。 |
| OnRebind(Intent) |
當新的用戶端已連線到服務時呼叫,之後,它先前已收到通知,指出其 |
| OnSilenceRinger() |
如果有鈴聲來電,則會被呼叫以讓鈴聲靜音。 |
| OnStart(Intent, Int32) |
已淘汰.
此方法在 API 等級 15 中被棄用。 (繼承來源 Service) |
| OnStartCommand(Intent, StartCommandFlags, Int32) |
每次用戶端透過呼叫 明確啟動服務時,由系統呼叫 |
| OnTaskRemoved(Intent) |
若服務目前正在執行,且使用者已移除來自該服務應用程式的任務,則會呼叫此服務。 (繼承來源 Service) |
| OnTimeout(Int32, ForegroundService) |
當特定前景服務類型逾時時,回撥呼叫。 (繼承來源 Service) |
| OnTimeout(Int32) |
在逾時呼叫的 |
| OnTrimMemory(TrimMemory) |
當作業系統判斷程序是刪除其程序中不需要記憶體的好時機時,會被呼叫。 (繼承來源 Service) |
| OnUnbind(Intent) |
當所有用戶端都已從服務發布的特定介面斷線時呼叫。 (繼承來源 Service) |
| OpenFileInput(String) |
開啟與此上下文應用程式套件相關的私人檔案以進行閱讀。 (繼承來源 ContextWrapper) |
| OpenFileOutput(String, FileCreationMode) |
開啟與此上下文應用程式套件相關的私有檔案以進行撰寫。 (繼承來源 ContextWrapper) |
| OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory, IDatabaseErrorHandler) |
開啟與此上下文應用程式套件相關的新私有 SQLiteDatabase。 (繼承來源 ContextWrapper) |
| OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory) |
開啟與此上下文應用程式套件相關的新私有 SQLiteDatabase。 (繼承來源 ContextWrapper) |
| PeekWallpaper() |
已淘汰.
將舊有壁紙查詢委派給基地上下文的窺視操作。 (繼承來源 ContextWrapper) |
| RebindService(IServiceConnection, Context+BindServiceFlags) |
重新綁定一個應用程式服務,並更新了 bind 服務旗標 (繼承來源 Context) |
| RegisterComponentCallbacks(IComponentCallbacks) |
在 Context 的基礎應用程式中新增 |
| RegisterDeviceIdChangeListener(IExecutor, IIntConsumer) |
新增一個裝置 ID,變更監聽器到 |
| RegisterReceiver(BroadcastReceiver, IntentFilter, ActivityFlags) |
已淘汰.
註冊以接收意圖廣播,接收端可選擇性地暴露給即時應用程式。 更多資訊請參閱 registerReceiver(BroadcastReceiver, IntentFilter)。 預設情況下,即時應用程式無法與其他應用程式中的接收器互動,這讓你可以公開一個接收器,讓即時應用程式能互動。 欲了解更多意圖廣播資訊,請參閱 BroadcastReceiver。 截至Build.VERSION_CODES年。UPSIDE_DOWN_CAKE ,系統可在應用程式處於快取狀態時,將上下文註冊的廣播放入佇列。 當應用程式離開快取狀態,例如回到前景時,系統會傳送所有排隊的廣播。 某些廣播的多個實例可能會合併成一個廣播。 截至Build.VERSION_CODES年。ICE_CREAM_SANDWICH,使用此方法註冊的接收器會正確遵守廣播意圖所指定的 Intent.setPackage(字串)。 在此之前,這份郵件會被忽略,並送達所有匹配的註冊收件人。 使用這些資料時要小心。 (繼承來源 ContextWrapper) |
| RegisterReceiver(BroadcastReceiver, IntentFilter, ReceiverFlags) |
註冊以接收意圖廣播,接收端可選擇性地暴露給即時應用程式。 更多資訊請參閱 registerReceiver(BroadcastReceiver, IntentFilter)。 預設情況下,即時應用程式無法與其他應用程式中的接收器互動,這讓你可以公開一個接收器,讓即時應用程式能互動。 欲了解更多意圖廣播資訊,請參閱 BroadcastReceiver。 截至Build.VERSION_CODES年。UPSIDE_DOWN_CAKE ,系統可在應用程式處於快取狀態時,將上下文註冊的廣播放入佇列。 當應用程式離開快取狀態,例如回到前景時,系統會傳送所有排隊的廣播。 某些廣播的多個實例可能會合併成一個廣播。 截至Build.VERSION_CODES年。ICE_CREAM_SANDWICH,使用此方法註冊的接收器會正確遵守廣播意圖所指定的 Intent.setPackage(字串)。 在此之前,這份郵件會被忽略,並送達所有匹配的註冊收件人。 使用這些資料時要小心。 (繼承來源 Context) |
| RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler, ActivityFlags) |
已淘汰.
註冊以接收意圖廣播,以便在排程器情境下執行。 更多資訊請參見 registerReceiver(BroadcastReceiver,IntentFilter,整數)與 registerReceiver(BroadcastReceiver,IntentFilter,String,Handler)。 欲了解更多意圖廣播資訊,請參閱 BroadcastReceiver。 截至Build.VERSION_CODES年。UPSIDE_DOWN_CAKE ,系統可在應用程式處於快取狀態時,將上下文註冊的廣播放入佇列。 當應用程式離開快取狀態,例如回到前景時,系統會傳送所有排隊的廣播。 某些廣播的多個實例可能會合併成一個廣播。 截至Build.VERSION_CODES年。ICE_CREAM_SANDWICH,使用此方法註冊的接收器會正確遵守廣播意圖所指定的 Intent.setPackage(字串)。 在此之前,這份郵件會被忽略,並送達所有匹配的註冊收件人。 使用這些資料時要小心。 (繼承來源 ContextWrapper) |
| RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler, ReceiverFlags) |
註冊以接收意圖廣播,以便在排程器情境下執行。 更多資訊請參見 registerReceiver(BroadcastReceiver,IntentFilter,整數)與 registerReceiver(BroadcastReceiver,IntentFilter,String,Handler)。 欲了解更多意圖廣播資訊,請參閱 BroadcastReceiver。 截至Build.VERSION_CODES年。UPSIDE_DOWN_CAKE ,系統可在應用程式處於快取狀態時,將上下文註冊的廣播放入佇列。 當應用程式離開快取狀態,例如回到前景時,系統會傳送所有排隊的廣播。 某些廣播的多個實例可能會合併成一個廣播。 截至Build.VERSION_CODES年。ICE_CREAM_SANDWICH,使用此方法註冊的接收器會正確遵守廣播意圖所指定的 Intent.setPackage(字串)。 在此之前,這份郵件會被忽略,並送達所有匹配的註冊收件人。 使用這些資料時要小心。 (繼承來源 Context) |
| RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler) |
註冊以接收意圖廣播,並在 var<排程器>/var< 的情境>下執行。 (繼承來源 ContextWrapper) |
| RegisterReceiver(BroadcastReceiver, IntentFilter) |
註冊一個廣播接收器(BroadcastReceiver)以便在主活動執行緒中執行。 (繼承來源 ContextWrapper) |
| RemoveStickyBroadcast(Intent) |
已淘汰.
代表們將保留的置軌廣播移除至基地情境。 (繼承來源 ContextWrapper) |
| RemoveStickyBroadcastAsUser(Intent, UserHandle) |
已淘汰.
將指定使用者的置頂廣播移除授權給基層上下文。 (繼承來源 ContextWrapper) |
| RequestBluetoothAudio(BluetoothDevice) |
請求音訊路由到特定的藍牙裝置。 |
| RequestCallEndpointChange(CallEndpoint, IExecutor, IOutcomeReceiver) |
請求音訊路由到特定的呼叫端點。 |
| RevokeSelfPermissionOnKill(String) |
觸發執行時權限的非同步撤銷。 (繼承來源 Context) |
| RevokeSelfPermissionsOnKill(ICollection<String>) |
會觸發撤銷呼叫套件一個或多個權限。 (繼承來源 Context) |
| RevokeUriPermission(String, Uri, ActivityFlags) |
移除先前以 grantUriPermission(String, Uri, int) 為特定目標套件新增的存取特定內容提供者 Uri 的權限。 給定的 Uri 會匹配所有先前獲得且相同或屬於該 Uri 子路徑的 Uri。 也就是說,撤銷「content://foo/target」會同時撤銷「content://foo/target」和「content://foo/target/sub」,但不會撤銷「content://foo」。 它不會移除任何存在於更高層級的前綴補助金。 與 revokeUriPermission(Uri,int) 不同,此方法僅會撤銷透過 grantUriPermission(String, Uri, int) 明確授予的權限,且僅限於指定的套件。 任何透過其他機制(剪貼簿、活動啟動、服務啟動等)達成的配對補助金都不會被移除。 (繼承來源 ContextWrapper) |
| RevokeUriPermission(Uri, ActivityFlags) |
移除先前在 中新增的所有存取特定內容提供者 Uri 的權限。 (繼承來源 ContextWrapper) |
| SendBroadcast(Intent, String, Bundle) |
將該意圖廣播給所有有興趣的廣播接收器,並允許執行可選的必要許可。 (繼承來源 Context) |
| SendBroadcast(Intent, String) |
將該意圖廣播給所有有興趣的廣播接收器,並允許執行可選的必要許可。 (繼承來源 ContextWrapper) |
| SendBroadcast(Intent) |
將該意圖廣播給所有有興趣的廣播接收器。 (繼承來源 ContextWrapper) |
| SendBroadcastAsUser(Intent, UserHandle, String) |
那個版本 SendBroadcast(Intent, String) 允許你指定廣播要傳送給哪個使用者。 (繼承來源 ContextWrapper) |
| SendBroadcastAsUser(Intent, UserHandle) |
那個版本 SendBroadcast(Intent) 允許你指定廣播要傳送給哪個使用者。 (繼承來源 ContextWrapper) |
| SendBroadcastWithMultiplePermissions(Intent, String[]) |
將該意圖廣播給所有有興趣的廣播接收器,允許執行一系列必要的權限。 (繼承來源 Context) |
| SendOrderedBroadcast(Intent, Int32, String, String, BroadcastReceiver, Handler, String, Bundle, Bundle) |
依序向有興趣的接收者廣播意圖。 (繼承來源 ContextWrapper) |
| SendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, Result, String, Bundle) |
那個版本 SendBroadcast(Intent) 允許你從廣播中接收回來的資料。 (繼承來源 ContextWrapper) |
| SendOrderedBroadcast(Intent, String, Bundle, BroadcastReceiver, Handler, Result, String, Bundle) |
那個版本 |
| SendOrderedBroadcast(Intent, String, Bundle) |
將所定意圖廣播給所有有興趣的廣播接收器,一次一個傳送,讓更多優先接收者先消化該廣播,然後再傳送給較不偏好的接收器。 (繼承來源 Context) |
| SendOrderedBroadcast(Intent, String, String, BroadcastReceiver, Handler, Result, String, Bundle) |
那個版本 |
| SendOrderedBroadcast(Intent, String) |
將所定意圖廣播給所有有興趣的廣播接收器,一次一個傳送,讓更多優先接收者先消化該廣播,然後再傳送給較不偏好的接收器。 此呼叫為非同步;它會立即回傳,並在接收器運行時繼續執行。 欲了解更多意圖廣播資訊,請參閱 BroadcastReceiver。 (繼承來源 ContextWrapper) |
| SendOrderedBroadcastAsUser(Intent, UserHandle, String, BroadcastReceiver, Handler, Result, String, Bundle) |
sendOrderedBroadcast(Intent, String, BroadcastReceiver, Handler, int, String, Bundle) 的版本,允許你指定廣播將傳送給哪個使用者。 此功能不適用於未預先安裝於系統映像中的應用程式。 欲了解更多意圖廣播資訊,請參閱 BroadcastReceiver。 需要 Android。Manifest.permission.INTERACT_ACROSS_USERS (繼承來源 ContextWrapper) |
| SendStickyBroadcast(Intent, Bundle) |
執行 |
| SendStickyBroadcast(Intent) |
已淘汰.
執行 |
| SendStickyBroadcastAsUser(Intent, UserHandle) |
已淘汰.
將指定使用者的黏著廣播委派給基底上下文。 (繼承來源 ContextWrapper) |
| SendStickyOrderedBroadcast(Intent, BroadcastReceiver, Handler, Result, String, Bundle) |
已淘汰.
將有序的黏著廣播及其結果回調論證委托到基層上下文中。 (繼承來源 ContextWrapper) |
| SendStickyOrderedBroadcastAsUser(Intent, UserHandle, BroadcastReceiver, Handler, Result, String, Bundle) |
已淘汰.
將指定使用者的有序黏著廣播委派給基底上下文。 (繼承來源 ContextWrapper) |
| SetAudioRoute(CallAudioRoute) |
設定音訊路由(喇叭、藍牙等)。 |
| SetAudioRoute(VideoQuality) |
已淘汰.
設定音訊路由(喇叭、藍牙等)。 |
| SetForeground(Boolean) |
此會員已被棄用。 (繼承來源 Service) |
| SetHandle(IntPtr, JniHandleOwnership) |
設定 Handle 屬性。 (繼承來源 Object) |
| SetMuted(Boolean) |
設定麥克風靜音狀態。 |
| SetPeerReference(JniObjectReference, JniObjectReferenceOptions) |
在控制區塊中儲存參考值,但不建立 JNI 參考副本。 (繼承來源 JavaObject) |
| SetTheme(Int32) |
為這個情境設定基本主題。 (繼承來源 ContextWrapper) |
| SetWallpaper(Bitmap) |
已淘汰.
把點陣圖傳給基礎上下文的舊壁紙設定器。 (繼承來源 ContextWrapper) |
| SetWallpaper(Stream) |
已淘汰.
將輸入串流傳給基底上下文的舊壁紙設定器。 (繼承來源 ContextWrapper) |
| ShouldShowRequestPermissionRationale(String) |
判斷你是否應該在申請許可前先展示 UI。 (繼承來源 Context) |
| StartActivities(Intent[], Bundle) |
啟動多項新活動。 (繼承來源 ContextWrapper) |
| StartActivities(Intent[]) |
就像 StartActivities(Intent[], Bundle) 沒有指定選項一樣。 (繼承來源 ContextWrapper) |
| StartActivity(Intent, Bundle) |
啟動一項新活動。 (繼承來源 ContextWrapper) |
| StartActivity(Intent) |
就像 StartActivity(Intent, Bundle) 沒有指定選項一樣。 (繼承來源 ContextWrapper) |
| StartActivity(Type) |
為指定的活動類型建立明確的意圖並啟動該活動。 (繼承來源 Context) |
| StartForeground(Int32, Notification, ForegroundService) |
具有其他 foregroundServiceType 參數的多載版本 |
| StartForeground(Int32, Notification) |
如果您的服務已啟動(執行中 |
| StartForegroundService(Intent) |
類似於 startService(Intent) ,但隱含承諾服務一旦開始執行就會呼叫 startForeground(int, android.app.Notification)。 服務會獲得相當於 ANR 間隔的時間來完成此事,否則系統會自動當機,屆時執行 SDK 版本 Build.VERSION_CODES 的裝置會記錄內部異常 ForegroundServiceDidNotStartInTimeException。S或更晚。 在較舊的 Android 版本中,會記錄一個內部例外 RemoteServiceException,並附有相應訊息。 與一般的 startService(Intent) 不同,此方法可隨時使用,無論服務的應用程式是否處於前景狀態。 注意:從 SDK 版本 Build.VERSION_CODES 開始。S,針對 SDK 版本 Build.VERSION_CODES 的應用程式。S 級以上的用戶不得從背景啟動前景服務。 詳情請參見行為變更:針對 Android 12 的應用程式。 (繼承來源 ContextWrapper) |
| StartInstrumentation(ComponentName, String, Bundle) |
開始執行一個 Instrumentation 類別。 (繼承來源 ContextWrapper) |
| StartIntentSender(IntentSender, Intent, ActivityFlags, ActivityFlags, Int32, Bundle) |
像 StartActivity(Intent, Bundle)是,但一開始就用一個意圖發送者。 (繼承來源 ContextWrapper) |
| StartIntentSender(IntentSender, Intent, ActivityFlags, ActivityFlags, Int32) |
與 startIntentSender(IntentSender, Intent, int, int, int, Bundle) 相同,但未指定任何選項。 (繼承來源 ContextWrapper) |
| StartService(Intent) |
請求啟動某項應用程式服務。 (繼承來源 ContextWrapper) |
| StopForeground(Boolean) |
舊版 的 |
| StopForeground(StopForegroundFlags) |
將此服務從前景狀態移除,若需要更多記憶體,便可終止。 (繼承來源 Service) |
| StopSelf() |
如果服務已經開始,請停止。 (繼承來源 Service) |
| StopSelf(Int32) |
舊版 |
| StopSelfResult(Int32) |
如果最近一次啟動服務是 startId,請停止服務。 (繼承來源 Service) |
| StopService(Intent) |
請求停止某項應用程式服務。 (繼承來源 ContextWrapper) |
| ToArray<T>() |
從這個 Java 陣列包裝器建立一個受管理陣列。 (繼承來源 Object) |
| ToString() |
回傳物件的字串表示。 (繼承來源 Object) |
| UnbindService(IServiceConnection) |
斷開應用程式服務。 (繼承來源 ContextWrapper) |
| UnregisterComponentCallbacks(IComponentCallbacks) |
移除 |
| UnregisterDeviceIdChangeListener(IIntConsumer) |
移除一個裝置 ID,變更了 Context 中的監聽者。 (繼承來源 Context) |
| UnregisterFromRuntime() |
將此 Java 節點從互通執行時中取消註冊。 (繼承來源 Object) |
| UnregisterReceiver(BroadcastReceiver) |
取消註冊先前註冊的廣播接收器。 (繼承來源 ContextWrapper) |
| UpdateServiceBindings(ICollection<Context.UpdateBindingParams>) |
對現有綁定進行批次更新。 (繼承來源 Context) |
| UpdateServiceGroup(IServiceConnection, Int32, Int32) |
對於先前綁定於 |
| Wait() |
使目前執行緒等待被喚醒,通常是透過 通知 或 中斷。 (繼承來源 Object) |
| Wait(Int64, Int32) |
使目前執行緒等待被喚醒(通常是透過 通知 或 中斷),或等待一定的實際時間過去。 (繼承來源 Object) |
| Wait(Int64) |
使目前執行緒等待被喚醒(通常是透過 通知 或 中斷),或等待一定的實際時間過去。 (繼承來源 Object) |
明確介面實作
| 名稱 | Description |
|---|---|
| IJavaPeerable.Disposed() |
標記此節點為處置,並以 |
| IJavaPeerable.Finalized() |
標記此節點為處置,並以 |
| IJavaPeerable.JniObjectReferenceControlBlock |
取得此對等端使用的原生控制區塊指標。 (繼承來源 JavaObject) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) |
儲存執行時提供的身份雜湊碼。 (繼承來源 JavaObject) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) |
取代儲存的受管理對等狀態旗標。 (繼承來源 JavaObject) |
| IJavaPeerable.SetPeerReference(JniObjectReference) |
當引用無效時,更新對等節點並釋放已拋棄節點的控制區塊。 (繼承來源 JavaObject) |
| IJavaPeerable.UnregisterFromRuntime() |
將此實例從執行時的 Java 物件查詢中移除。 (繼承來源 Service) |
擴充方法
| 名稱 | Description |
|---|---|
| GetJniTypeName(IJavaPeerable) |
取得實例 |
| JavaAs<TResult>(IJavaPeerable) |
試著強制 |
| JavaCast<TResult>(IJavaObject) |
執行 Android 執行時檢查型別轉換。 |
| JavaCast<TResult>(IJavaObject) |
重用相容的受管理對等端或取得請求型態的包裝器。 |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
試著強制 |