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

"Native method not found" , clean the memory.

More
IP: 192.168.0.71 11 years 4 months ago #7765 by oemilk
Hi.

As we know, "Global.init()" method calls a native library.
So it calls at first activity.

But I had called it before the rendering activity.
Because I need a bitmap which PDF file's first page.

Anyway, my question is that memory widget clean feature.
Start app >> open the PDF file >> Show PDF redering page >> Click the device HOME button
>> Clean a memory when do memory widget's. >> Restart app >> crash..

So I put the "Global.init()" method into a rendering activity.
But I has a problem.
"Global.init()" method called twice....

Do you have any solutions about this??
For example,
How can I check the library's activity?
or Close the native library??

Code:
11-17 14:19:11.874: E/ACRA(27358): ACRA caught a UnsatisfiedLinkError exception for com.access_company.android.docdrive. Building report. 11-17 14:19:14.997: E/ACRA(27358): com.access_company.android.docdrive fatal error : Native method not found: com.radaee.pdf.Document.open:(Ljava/lang/String;Ljava/lang/String;)I 11-17 14:19:14.997: E/ACRA(27358): java.lang.UnsatisfiedLinkError: Native method not found: com.radaee.pdf.Document.open:(Ljava/lang/String;Ljava/lang/String;)I 11-17 14:19:14.997: E/ACRA(27358): at com.radaee.pdf.Document.open(Native Method) 11-17 14:19:14.997: E/ACRA(27358): at com.radaee.pdf.Document.Open(Document.java:417) 11-17 14:19:14.997: E/ACRA(27358): at com.access_company.android.docdrive.pdf.activity.PDFReaderActivity.PDFReaderInit(PDFReaderActivity.java:235) 11-17 14:19:14.997: E/ACRA(27358): at com.access_company.android.docdrive.pdf.activity.PDFReaderActivity.access$8(PDFReaderActivity.java:231) 11-17 14:19:14.997: E/ACRA(27358): at com.access_company.android.docdrive.pdf.activity.PDFReaderActivity$1.handleMessage(PDFReaderActivity.java:106) 11-17 14:19:14.997: E/ACRA(27358): at android.os.Handler.dispatchMessage(Handler.java:102) 11-17 14:19:14.997: E/ACRA(27358): at android.os.Looper.loop(Looper.java:136) 11-17 14:19:14.997: E/ACRA(27358): at android.app.ActivityThread.main(ActivityThread.java:5103) 11-17 14:19:14.997: E/ACRA(27358): at java.lang.reflect.Method.invokeNative(Native Method) 11-17 14:19:14.997: E/ACRA(27358): at java.lang.reflect.Method.invoke(Method.java:515) 11-17 14:19:14.997: E/ACRA(27358): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) 11-17 14:19:14.997: E/ACRA(27358): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606) 11-17 14:19:14.997: E/ACRA(27358): at dalvik.system.NativeStart.main(Native Method)
More
IP: 192.168.0.71 11 years 4 months ago #7773 by radaee
you can declare a static boolean var, init as false.
each time need to invoke Global.Init(), check boolean value first.
if false, invoke Global.Init(), and set var as true.
if true, ignore invoke.
More
IP: 192.168.0.71 11 years 4 months ago #7838 by oemilk
Thank you.
Time to create page: 0.393 seconds
Powered by Kunena Forum