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?

More
9 years 10 months ago - 9 years 10 months ago #11340 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!
Last edit: 9 years 10 months ago by RickB. Reason: typo
More
9 years 10 months ago #11341 by Davide
Hi,
we have sent your post to our developers, they will check it and get back to you as soon as possible.
More
9 years 10 months ago #11368 by nermeen
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
More
9 years 10 months ago #11370 by RickB
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
Time to create page: 0.394 seconds
Powered by Kunena Forum