語言

PackageManager.GetResourcesForActivity(ComponentName) 方法

定義

取回與某項活動相關的資源。

[Android.Runtime.Register("getResourcesForActivity", "(Landroid/content/ComponentName;)Landroid/content/res/Resources;", "GetGetResourcesForActivity_Landroid_content_ComponentName_Handler")]
public abstract Android.Content.Res.Resources GetResourcesForActivity(Android.Content.ComponentName activityName);
[<Android.Runtime.Register("getResourcesForActivity", "(Landroid/content/ComponentName;)Landroid/content/res/Resources;", "GetGetResourcesForActivity_Landroid_content_ComponentName_Handler")>]
abstract member GetResourcesForActivity : Android.Content.ComponentName -> Android.Content.Res.Resources

參數

activityName
ComponentName

要取回資源的活動名稱。

傳回

回傳應用程式的資源。

屬性

例外狀況

若無法載入該應用程式的資源,則會丟棄。

備註

取回與某項活動相關的資源。 給定活動的全名後,會取得相關資訊並呼叫 getResources() 以回傳應用程式的資源。 若找不到該活動,則會拋出 NameNotFoundException。

Java 文件 android.content.pm.PackageManager.getResourcesForActivity(android.content.ComponentName)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

另請參閱