Hi, Stefan

According to your crash log, it seems your device doesn’t have enough memory to 
have 4 xwalk views in memory at the same time. May I know the configuration of 
your device? You might try with some simple local pages to only test the tab 
switching.

If memory is limited, you will have to re-create the fragment frequently when 
switching tab. You need to save tabs’ state in its onDestroyView() callback and 
restore the state when createView() get called to re-create the fragment.

Thanks,
Shiliu.

From: Stefan Persson [mailto:[email protected]]
Sent: Friday, August 29, 2014 12:36 AM
To: Wang, Shiliu
Cc: [email protected]
Subject: Re: [Crosswalk-help] Embedding XWalkView in FragmentPagerAdapter

Hi Shiliu,

First of all thanks for support!
It was very interesting to hear that you have tested and got it to work.
But unfortunately I cannot make it to work...

I checked the XWalkCoreShell source code and could not find any major 
difference vs. my implementation.
So I tried to run your code but it crashes when I test with 4 tabs.

So what did I do?
added:
- mViewPager.setOffscreenPageLimit(4);
- added two more mActionBar tabs

tested with urls:
- http://google.com
- http://expressen.se
- http://aftonbladet.se
- http://jayway.com

parts from log:
below is repeated several times and finally a crash.
08-28 18:16:44.684  26416-26544/org.xwalk.core.xwview.shell E/qdmemalloc﹕ ion: 
Failed to map memory in the client: Out of memory
08-28 18:16:44.684  26416-26544/org.xwalk.core.xwview.shell E/qdgralloc﹕ Could 
not mmap handle 0x82735700, fd=413 (Out of memory)
08-28 18:16:44.684  26416-26544/org.xwalk.core.xwview.shell E/qdgralloc﹕ 
gralloc_register_buffer: gralloc_map failed
08-28 18:16:44.684  26416-26544/org.xwalk.core.xwview.shell 
W/GraphicBufferMapper﹕ registerBuffer(0x82735700) failed -12 (Out of memory)
08-28 18:16:44.684  26416-26544/org.xwalk.core.xwview.shell E/GraphicBuffer﹕ 
unflatten: registerBuffer failed: Out of memory (-12)
08-28 18:16:44.684  26416-26544/org.xwalk.core.xwview.shell W/Adreno-EGLSUB﹕ 
<SyncBackBuffer:3233>: handle base address is NULL
08-28 18:16:44.684  26416-26544/org.xwalk.core.xwview.shell W/Adreno-ES20﹕ 
<core_glFlush:52>: GL_OUT_OF_MEMORY
08-28 18:16:44.684  26416-26544/org.xwalk.core.xwview.shell W/Adreno-EGLSUB﹕ 
<SyncBackBuffer:3233>: handle base address is NULL
08-28 18:16:44.684  26416-26544/org.xwalk.core.xwview.shell W/Adreno-EGL﹕ 
<qeglDrvAPI_eglSwapBuffers:3692>: EGL_BAD_ALLOC
...
08-28 18:17:09.094  26416-26989/org.xwalk.core.xwview.shell W/Adreno-GSL﹕ 
<sharedmem_gpumem_alloc_id:1434>: sharedmem_gpumem_alloc: mmap failed
errno 12 Out of memory
08-28 18:17:09.094  26416-26989/org.xwalk.core.xwview.shell E/Adreno-GSL﹕ 
<ioctl_kgsl_sharedmem_alloc:1535>: ioctl_kgsl_sharedmem_alloc: FATAL ERROR : 
(null)

Br
Stefan






2014-08-27 8:12 GMT+02:00 Wang, Shiliu 
<[email protected]<mailto:[email protected]>>:
Hi, Stefan

Actually, XWalkCoreShell is using ViewPager to contain two XWalkView instances. 
You can get it in test_apks package from 
https://download.01.org/crosswalk/releases/crosswalk/android. I’ve been trying 
to reproduce the issue you described on XWalkCoreShell (extends tab count to 4 
locally), it doesn’t appear.

Basically, behavior will be quite different depends how you implement your 
pageAdapter, especially the part how you reuse the fragment. For xwalkView 
cases, suggestion is to never reuse Fragment. And to keep it from being 
destroyed and re-created all the time, I suggest to call 
mViewPager.setOffscreenPageLimit(4) in your case.

Thanks,
Shiliu.

From: Crosswalk-help 
[mailto:[email protected]<mailto:[email protected]>]
 On Behalf Of Stefan Persson
Sent: Wednesday, August 27, 2014 3:46 AM
To: 
[email protected]<mailto:[email protected]>
Subject: [Crosswalk-help] Embedding XWalkView in FragmentPagerAdapter

Hi,

In a project I am working in there is a requirement to have a ViewPager with 
FragmentPagerAdapter having 4 pages. Each page (fragment with one XWalkView 
instance / fragment) load different urls where the webpage is build using 
angular.

Problem I have is that very often content from an other page then the one that 
is selected is showing up when I change pages.
(When having selected page #2 the view from page #3 is visible)

When I replace XViewView with build in ChromeClient in Android 4.4 it works 
perfectly.
I have verified that the correct fragment and correct url is loaded for each 
page.

I wonder if anyone have tried to do similar solution as me and if it is 
supported?
If any one could give me some ideas on what to try out to get it to work?

using crosswalk-webview-8.37.189.2-arm
Tested on Nexus 5 and Samsung S3 with same result.

Br
Stefan

_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to