Android Question Add google doc url to bbview

I am using bbview named gdoclink. I pass the google webapp url to the following function:
B4X:
Sub hitAPI (url As String)
    Dim job As HttpJob
    pb.Visible=True
    'logoProgress("start")
    job.Initialize("",Me)
    job.Download(url)
    Wait for (job) JobDone(job As HttpJob)
    'logoProgress("stop")
    If job.Success Then
        pb.Visible=False
      [B]  Log(job.GetString)
        gdoclink.Text=$"[url=${job.GetString}]Google Doc Report[/url]"$[/B]
        gdoclink.mBase.Visible=True
    Else
        Log(job.ErrorMessage)
    End If
    job.Release    
End Sub
I get null object reference error in the highlighted line.although I get the google doc url in logger:

Please help!
 
Solution
BBLabel doesn't expose this event. You need to use BBCodeView.

You should then handle the LinkClicked event and open it with:
B4X:
Dim in As Intent
in.Initialize(in.ACTION_VIEW, url)
StartActivity(in)
I wasn't aware that BCTextEngine too had to be declared and initialized to use bblabel.
Now I get the google doc's link in the code
B4X:
gdoclink.Text=$"[url=${job.GetString}]Google Doc Report[/url]"$[/B]
However it isn't 'clickable '. I expected the link to open the google doc. How to make the hyperlink open the google doc?
thanks
 
Upvote 0
Thank you. Good to know about BBCode View.
In this particular app prototype, I already used the long click event of a label:
B4X:
Private Sub lblGoogledoc_LongClick
    Dim ph As PhoneIntents       
    Dim i As Intent
    i = ph.OpenBrowser(gdocurl)
    StartActivity(i)
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…