簡體   English   中英

如何獲得代表片段包的 Bundle object?

[英]How to get the Bundle object which represents a fragment bundle?

我在片段包中嘗試了以下代碼

Bundle bundle = FrameworkUtil.getBundle( getClass() );

但是bundle object 仍然代表主機bundle,如何獲得代表片段bundle 的 Bundle object?

類總是由主機包加載。 因此,不可能使用FrameworkUtil.getBundle(Class)為包含 class 的片段獲取 Bundle object 。

給定主機 Bundle object,然后您可以找到附加的片段。 請參閱https://docs.osgi.org/specification/osgi.core/8.0.0/framework.wiring.html#d0e13920

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM