- Posts: 4
- 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
How to realize openning URL
IP: 192.168.0.71
11 years 5 months ago #6899
by bodhixu
How to realize openning URL was created by bodhixu
how to realize to shift to the outside browser when you are tapping the text liking URL.
IP: 192.168.0.156
11 years 5 months ago #6922
by Davide
Replied by Davide on topic How to realize openning URL
Hi,
you have to handle it on OnOpenURI method in PDFReaderAct class.
Something like that:
You can also check this:
www.androidpdf.mobi/forum/Android-develo...en-taping-on-it#6005
you have to handle it on OnOpenURI method in PDFReaderAct class.
Something like that:
Code:
public void OnOpenURI(String uri)
{
if(uri != null){
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(uri));
startActivity(i);
}
}
You can also check this:
www.androidpdf.mobi/forum/Android-develo...en-taping-on-it#6005
IP: 192.168.0.71
11 years 5 months ago #6930
by bodhixu
Replied by bodhixu on topic How to realize openning URL
thanks,
int dest = m_annot.GetDest();
if( dest >= 0 )
m_view.vGotoPage(dest);
String uri = m_annot.GetURI();
if( m_listener != null )
m_listener.OnOpenURI(uri);
but i want to kown how to instantiate the m_annot when tapping the pdf;
int dest = m_annot.GetDest();
if( dest >= 0 )
m_view.vGotoPage(dest);
String uri = m_annot.GetURI();
if( m_listener != null )
m_listener.OnOpenURI(uri);
but i want to kown how to instantiate the m_annot when tapping the pdf;
IP: 192.168.0.156
11 years 5 months ago #6935
by Davide
Replied by Davide on topic How to realize openning URL
Hi,
m_annot is instantiated in OnPDFSingleTapped method in PDFReader class:
If you want to open the url without using the "Do Button" of the Demo Project you can call the methods you need to open the URL in the OnPDFSingleTapped method.
m_annot is instantiated in OnPDFSingleTapped method in PDFReader class:
Code:
m_annot = page.GetAnnotFromPoint(m_annot_pos.x, m_annot_pos.y);
If you want to open the url without using the "Do Button" of the Demo Project you can call the methods you need to open the URL in the OnPDFSingleTapped method.
IP: 192.168.0.71
11 years 5 months ago - 11 years 5 months ago #6939
by radaee
Replied by radaee on topic How to realize openning URL
in PDFReaderAct.OnAnnotClicked() (single tapped on the annotation shall fired this method under professional or premium license.)
just invoke m_view.PDFPerformAnnot();
then OnOpenURL shall invoked, if an URL annotation clicked.
just invoke m_view.PDFPerformAnnot();
then OnOpenURL shall invoked, if an URL annotation clicked.
Last edit: 11 years 5 months ago by .
IP: 192.168.0.71
11 years 5 months ago #6955
by bodhixu
Replied by bodhixu on topic How to realize openning URL
Thank you very much, but I still have a few doubts.
1、
If I invoke the OnPDFSingleTapped(float x, float y),what is the parameter of x,y?
Is it the position on the screen?
2、
PDFReaderAct.OnAnnotClicked() is invoked automatically or manually call?
I'm standard license, is the PDFReaderAct.OnAnnotClicked() effective?
1、
If I invoke the OnPDFSingleTapped(float x, float y),what is the parameter of x,y?
Is it the position on the screen?
2、
PDFReaderAct.OnAnnotClicked() is invoked automatically or manually call?
I'm standard license, is the PDFReaderAct.OnAnnotClicked() effective?
Time to create page: 0.461 seconds