- Posts: 5
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Global.init() - how come Activity and not Context?
9 years 10 months ago - 9 years 10 months ago #11340
by RickB
Global.init() - how come Activity and not Context? was created by RickB
Hi,
I'm looking at your library and I see the Global.init() function requires an Activity as the first parameter. This is a bit confusing as I wonder if I have to call the init() function on each activity?
I checked the code and it looks like it doesn't need an Activity at all - just the Context. I'd prefer to call the init() from my Application class as I use the library to read PDFs before they're even shown (so before the Activity class would call the init() function.
It looks like I could just modify the ViewLib code myself, but since that will break on an update, is this simple change something you could do?
Thanks!
I'm looking at your library and I see the Global.init() function requires an Activity as the first parameter. This is a bit confusing as I wonder if I have to call the init() function on each activity?
I checked the code and it looks like it doesn't need an Activity at all - just the Context. I'd prefer to call the init() from my Application class as I use the library to read PDFs before they're even shown (so before the Activity class would call the init() function.
It looks like I could just modify the ViewLib code myself, but since that will break on an update, is this simple change something you could do?
Thanks!
Last edit: 9 years 10 months ago by RickB. Reason: typo
9 years 10 months ago #11341
by Davide
Replied by Davide on topic Global.init() - how come Activity and not Context?
Hi,
we have sent your post to our developers, they will check it and get back to you as soon as possible.
we have sent your post to our developers, they will check it and get back to you as soon as possible.
9 years 10 months ago #11368
by nermeen
Replied by nermeen on topic Global.init() - how come Activity and not Context?
Dear Rick,
A new beta version 3.8.1beta2 has been published.
Global.Init accepts Context object as parameter but the Context object must be derived from ContextWrapper, otherwise it may cause a crash in the native part that is using ContextWrapper, because Context.getPackageName() is abstract method, without implementation
A new beta version 3.8.1beta2 has been published.
Global.Init accepts Context object as parameter but the Context object must be derived from ContextWrapper, otherwise it may cause a crash in the native part that is using ContextWrapper, because Context.getPackageName() is abstract method, without implementation
9 years 10 months ago #11370
by RickB
Replied by RickB on topic Global.init() - how come Activity and not Context?
Thanks Nermeen!
I appreciate both Radaee's willingness to consider improvements and your quick response! I will try this out once I have the other PDF stuff on my plate finished.
-Rick
I appreciate both Radaee's willingness to consider improvements and your quick response! I will try this out once I have the other PDF stuff on my plate finished.
-Rick
Time to create page: 0.394 seconds