I am writing a plugin for a third-party app. The plugin app loads a library through maven that executes majority of the tasks. Imagine it as the plugin app handles everything UI related (clicks, drawing, etc), while the library handles the logic.
The thirdparty app gives me a context and resources variables. If I execute this in the plugin:
resources.getString(id) // Returns String
context.getString(id) // Resources$NotFoundException: String resource ID #0x...
but if I pass context and resources as variables into the library:
resources.getString(id) // Resources$NotFoundException: String resource ID #0x...
context.getString(id) // Resources$NotFoundException: String resource ID #0x...
Now, the id
is from the library package - com.my.lib.R.string.some_string
Why cant I access the resources of my own library? How do access the resources without any other context or resource variable?