- Posts: 1
- 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
Out of memory using viewpager
- vitorpradoveri
- Topic Author
- Offline
- New Member
-
Less
More
10 years 1 month ago #10212
by vitorpradoveri
Out of memory using viewpager was created by vitorpradoveri
I've bought the license to use Radaee in Android app.
I need to setup the pdf using a ViewPager, I found the example in RDPDFReader..
But the PDFViewPager throws an out of memory exception after some pages.
I was looking into PDFViewPager implementation and I found an array with the pages, and it's never released by GC.
maybe this is the problem.. I really don't know how can i solve this. I need to implement my own viewpager with my own adapter?
I need to setup the pdf using a ViewPager, I found the example in RDPDFReader..
But the PDFViewPager throws an out of memory exception after some pages.
I was looking into PDFViewPager implementation and I found an array with the pages, and it's never released by GC.
maybe this is the problem.. I really don't know how can i solve this. I need to implement my own viewpager with my own adapter?
10 years 1 month ago #10217
by Davide
Replied by Davide on topic Out of memory using viewpager
Hi,
can you reproduce this issue with all the pdfs? Can you please send us one of your pdfs to test it..
I invite you to open a new ticket bout that issue here: www.radaeepdf.com/support/tickets
can you reproduce this issue with all the pdfs? Can you please send us one of your pdfs to test it..
I invite you to open a new ticket bout that issue here: www.radaeepdf.com/support/tickets
10 years 2 weeks ago #10364
by alolip
Replied by alolip on topic Out of memory using viewpager
Is there a solution for this issue?
I'm having it too,
seems like objects are never released
I'm having it too,
seems like objects are never released
10 years 2 weeks ago #10366
by radaee
Replied by radaee on topic Out of memory using viewpager
hi, u maybe using old version.
plz check codes for PDFViewPager class, there are implment codes for PagerAdapter:
callback method destroyItem shall free memories.
plz check codes for PDFViewPager class, there are implment codes for PagerAdapter:
Code:
private class PDFPageAdapter extends PagerAdapter
{
private Document m_doc;
public PDFPageAdapter(Context ctx, Document doc)
{
m_thread = new VThread(m_hand_ui);
m_thread.start();
m_thread_cache = new VThread(m_hand_ui);
m_thread_cache.start();
int cnt = doc.GetPageCount();
m_pages = new PDFPageView[cnt];
m_doc = doc;
int cur;
for(cur = 0; cur < cnt; cur++)
{
m_pages[cur] = new PDFPageView(ctx);
//m_pages[cur].vOpen(m_thread, m_thread_cache, doc, cur, m_fit_type);
}
}
@Override
public java.lang.Object instantiateItem(android.view.ViewGroup container, int position)
{
if(!m_pages[position].vIsOpened())//lazy loading.
m_pages[position].vOpen(m_thread, m_thread_cache, m_doc, position, m_fit_type);
container.addView(m_pages[position]);
return m_pages[position];
}
@Override
public int getCount()
{
return m_pages.length;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object)
{
m_pages[position].vFreeCache();
container.removeView(m_pages[position]);
}
@Override
public boolean isViewFromObject(View view, Object o)
{
return view == o;
}
@Override
public CharSequence getPageTitle(int position)
{
return "Page:" + position;
}
}
IP: 192.168.0.71
10 years 2 weeks ago #10367
by alolip
Replied by alolip on topic Out of memory using viewpager
Is there a solution for this issue?
I'm having it too,
seems like objects are never released
I'm having it too,
seems like objects are never released
- thiagopelikan
- Offline
- Junior Member
-
Less
More
- Posts: 36
- Thank you received: 0
9 years 10 months ago #10563
by thiagopelikan
Replied by thiagopelikan on topic Out of memory using viewpager
Same here!
Time to create page: 0.385 seconds