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