Android Question What3words - open mobile app from code on a specific w3w location

chrishancox

New Member
I'm using the following code to open the What3Words app on my phone from a button click. W3w opens successfully but at the moment I have to manually paste the three words into the search field on the W3W app (hence the code to copy the three words into clipboard at the start of my code.

How do I modify 'Intent1 = pm.GetApplicationIntent ("com.what3words.android")' so that it opens the W3W app with it already referencing the location (which is recorded in my variable tipDataW3wArray(counter)?

Thanks all and apologies if this is a dumb question, I'm a self taught newbie with absolutely no IT background, I've been creating my app for work for almost 5 months now relying solely on forum posts and online tutorials and I'm almost finished. Your help would be very much appreciated.


My code:
Private Sub Button5_Click
    copyW3w.clrText
    copyW3w.setText(tipDataW3wArray(counter))
    
    
    Try
        Dim Intent1 As Intent
        Dim pm As PackageManager
        Intent1 = pm.GetApplicationIntent ("com.what3words.android")
        StartActivity (Intent1)
        ToastMessageShow("W3W location copied to clipboard, now paste in search field.", True)
    Catch
        ToastMessageShow("Failed to launch W3W App! Is it installed? W3W location copied to clipboard anyway.", True)
    End Try
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…