Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fragment dependency on other fragments

I have a plugin which is the host of fragment A & B. I export a package using Export-Package header from fragment A. Hopefully I can import that package in fragment B using Import-Package header. But the PDE reports that the dependency is unresolved. Is it possible at all using this scenario ? The following post http://www.eclipse.org/forums/index.php/t/238204/ confirms that it is.

Any help would be greatly appreciated.

Thanks & Regards,

Setya

like image 513
SetNug Avatar asked Sep 06 '11 02:09

SetNug


People also ask

How does a fragment communicate with other fragments?

We can communicate within fragments using the ViewModel. We can also communicate between fragments using Interface.

How can we send data from one fragment to another?

Step 1 − Create a new project in Android Studio, go to File ⇉ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml. Step 3 − Create two FragmentActivity and add the codes which are given below.

Can we have a fragment inside another fragment in android?

Fragments are also capable of hosting one or more child fragments. Inside a fragment, you can get a reference to the FragmentManager that manages the fragment's children through getChildFragmentManager() . If you need to access its host FragmentManager , you can use getParentFragmentManager() .


1 Answers

The scenario described is perfectly possible in runtime, however PDE is not aware of the dependency at build time. You need to add the header Eclipse-ExtensibleAPI: true to the host bundle of fragment A.

To reiterate, this header is only used at build time by PDE and is not an OSGi header.

like image 111
Neil Bartlett Avatar answered Nov 30 '22 23:11

Neil Bartlett