本文整理汇总了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();
}
}