问题
I have made a widget that is working fine on its part and also i have made and app for that is working well too in its part.
Now i want to integrate this widget into my application such that both are under same package.
how can i do this ??
do i have to make changes in manifest file.
I have done R&D but all links are for developing the widget from the start..none is on integration.
i have seen alot but found nothing helpful. Please help me in this regard.
Thanks in advance.
回答1:
It work for me by copying all my widget files to the project to which i want to integrate into. Now when i install the application in the device, its widget also gets installed
回答2:
I'm not an apologist of Copy-and-paste programming, so after a bit research we found a way to integrate a widget into several different projects.
- Turn the Widget project into a Library project :
properties -> Android ->and tickIs Library - Go to the original project and import the Widget project :
properties -> Android -> Add - In the original project's Manifest, add the text between the
<receiver>(...)</receiver>, including<intent-filter />and<meta-data/>, into the<application>(...)</application>
And presto, App + Widget integration with no Copy-Paste programming!
来源:https://stackoverflow.com/questions/12001296/integration-of-my-widget-with-my-application