So far I have used Compile To Lib with great success in making my apps more compact and sharing code easier.
However there are a couple of things/concepts I struggle with.
So my main app has a service called MyService.
The compiled lib has MyClass and MyActivity. Only MyClass will call MyActivity.
So MyService instantiates MyClass. And calls a sub to start MyActivity.
Now basically MyActivity cannot see any of the process_globals from the main app, atleast not at compile time of the library. Can it see or access them at runtime?
HotShoe figured one way of doing that would be to use a code module, and use it to assign process_globals in the library, but you would need them defined in advance.
Instead I was using CallSubDelayed from MyClass to pass the class itself to MyActivity, but it would not show since there were no visible activities in the app. Eventually I got it to show using StartActivity after CallSubDelayed.
Is there an easier way to pass data to/from Activities compiled in libaries?
My second question is regarding manifest.
So I declare a theme to be Holo.Light in the manifest project for MyActivity. Once compiled to library, and the activity is launched, it uses the default theme.
But if I put this line in the manifest of the main app with MyService now, it does not compile saying MyActivity is not declared.
So how do I change the theme of this activity?
However there are a couple of things/concepts I struggle with.
So my main app has a service called MyService.
The compiled lib has MyClass and MyActivity. Only MyClass will call MyActivity.
So MyService instantiates MyClass. And calls a sub to start MyActivity.
Now basically MyActivity cannot see any of the process_globals from the main app, atleast not at compile time of the library. Can it see or access them at runtime?
HotShoe figured one way of doing that would be to use a code module, and use it to assign process_globals in the library, but you would need them defined in advance.
Instead I was using CallSubDelayed from MyClass to pass the class itself to MyActivity, but it would not show since there were no visible activities in the app. Eventually I got it to show using StartActivity after CallSubDelayed.
Is there an easier way to pass data to/from Activities compiled in libaries?
My second question is regarding manifest.
So I declare a theme to be Holo.Light in the manifest project for MyActivity. Once compiled to library, and the activity is launched, it uses the default theme.
But if I put this line in the manifest of the main app with MyService now, it does not compile saying MyActivity is not declared.
So how do I change the theme of this activity?