當前位置: 首頁>>代碼示例>>Java>>正文


Java PackageManager.getReceiverInfo方法代碼示例

本文整理匯總了Java中android.content.pm.PackageManager.getReceiverInfo方法的典型用法代碼示例。如果您正苦於以下問題:Java PackageManager.getReceiverInfo方法的具體用法?Java PackageManager.getReceiverInfo怎麽用?Java PackageManager.getReceiverInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.content.pm.PackageManager的用法示例。


在下文中一共展示了PackageManager.getReceiverInfo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: DynCodecInfos

import android.content.pm.PackageManager; //導入方法依賴的package包/類
/**
 * Build codec infos based on a component name of a manifest
 * It will retrieve {@link SipManager#META_LIB_NAME} and {@link SipManager#META_LIB_INIT_FACTORY} from the meta datas of the component
 * @param ctxt The current application context
 * @param cmp The component name of the remote plugin application
 * @throws NameNotFoundException If the remote component is not found
 */
public DynCodecInfos(Context ctxt, ComponentName cmp) throws NameNotFoundException {
	PackageManager pm = ctxt.getPackageManager();
	ActivityInfo infos = pm.getReceiverInfo(cmp, PackageManager.GET_META_DATA);
	factoryInitFunction = infos.metaData.getString(SipManager.META_LIB_INIT_FACTORY);
          factoryDeinitFunction = infos.metaData.getString(SipManager.META_LIB_DEINIT_FACTORY);
	
	String libName = infos.metaData.getString(SipManager.META_LIB_NAME);
	
	PackageInfo pInfos = pm.getPackageInfo(cmp.getPackageName(), PackageManager.GET_SHARED_LIBRARY_FILES);
	// TODO : for now only api-9 compatible
	File libFile = NativeLibManager.getLibFileFromPackage(pInfos.applicationInfo, libName, true);
	if(libFile != null) {
		libraryPath = libFile.getAbsolutePath(); 
	}
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:23,代碼來源:ExtraPlugins.java


注:本文中的android.content.pm.PackageManager.getReceiverInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。