C Cor Active Member Licensed User Longtime User Jan 23, 2011 #1 gives error no activity found to handle Intent using android 8 sdk phone lib 1.31 Code: dim p as phoneintents dim url as string url="maps.google.nl/maps?f=d&source=s_d&saddr=parklaan+20+oss&daddr=hunnenpad+6+oss&hl=nl" StartActivity(p.OpenBrowser(url))
gives error no activity found to handle Intent using android 8 sdk phone lib 1.31 Code: dim p as phoneintents dim url as string url="maps.google.nl/maps?f=d&source=s_d&saddr=parklaan+20+oss&daddr=hunnenpad+6+oss&hl=nl" StartActivity(p.OpenBrowser(url))
Erel B4X founder Staff member Licensed User Longtime User Jan 23, 2011 #2 You should add "http://" to the url. Upvote 0
C csgoh Member Licensed User Longtime User Jan 18, 2012 #4 How could I open a local html file in SD card? I tried this, but got 'no activity found to handle Intent' error Code: Dim p As PhoneIntents StartActivity(p.OpenBrowser("file:///mnt/sdcard/dmDoc.html")) Any other suggestions? Upvote 0
How could I open a local html file in SD card? I tried this, but got 'no activity found to handle Intent' error Code: Dim p As PhoneIntents StartActivity(p.OpenBrowser("file:///mnt/sdcard/dmDoc.html")) Any other suggestions?
Erel B4X founder Staff member Licensed User Longtime User Jan 18, 2012 #5 You will need to explicitly set the default browser as the target: Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "1.html")) i.SetComponent("com.android.browser/.BrowserActivity") StartActivity(i) Upvote 0
You will need to explicitly set the default browser as the target: Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "1.html")) i.SetComponent("com.android.browser/.BrowserActivity") StartActivity(i)
D Dman Active Member Licensed User Longtime User Aug 22, 2012 #6 I added this code and got this error. Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirInternal, "invoice.html"))' i.SetComponent("com.android.browser/.BrowserActivity") StartActivity(i) and got this error. An error has occured in sub: invoice_btnemail_click (java line:414) android.content.ActivityNotFoundException: Unable to find explicit activity class {com. android.browser/com.android.browser. BrowserActivity}; have you declared this activity in your AndroidManifest.xml? Continue? Any ideas? Upvote 0
I added this code and got this error. Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirInternal, "invoice.html"))' i.SetComponent("com.android.browser/.BrowserActivity") StartActivity(i) and got this error. An error has occured in sub: invoice_btnemail_click (java line:414) android.content.ActivityNotFoundException: Unable to find explicit activity class {com. android.browser/com.android.browser. BrowserActivity}; have you declared this activity in your AndroidManifest.xml? Continue? Any ideas?
Erel B4X founder Staff member Licensed User Longtime User Aug 23, 2012 #7 Which device are you using? It seems like the default system browser is not installed. Upvote 0
D Dman Active Member Licensed User Longtime User Aug 23, 2012 #8 I have the Galaxy Nexus and the browser is there. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Aug 23, 2012 #9 This is the problem with explicitly setting the activity and package. It changed in Android 4 (at least on the Galaxy Nexus) and now you should use: Code: i.SetComponent("com.google.android.browser/com.android.browser.BrowserActivity") Upvote 0
This is the problem with explicitly setting the activity and package. It changed in Android 4 (at least on the Galaxy Nexus) and now you should use: Code: i.SetComponent("com.google.android.browser/com.android.browser.BrowserActivity")
Erel B4X founder Staff member Licensed User Longtime User Aug 24, 2012 #11 Tip: I found it by checking the unfiltered logs while clicking on the browser icon. The intent is printed in the logs (intents are always printed to the logs). Upvote 0
Tip: I found it by checking the unfiltered logs while clicking on the browser icon. The intent is printed in the logs (intents are always printed to the logs).
M mistermentality Active Member Licensed User Longtime User May 22, 2013 #12 I'm having the exact same error message using the amended code on a stock Nexus 7 running Android 4.2 trying to open a local web page from my apps internal directory (not assets folder) in web browser. I was wondering has anyone found a way around this that works on 4.2? Dave Upvote 0
I'm having the exact same error message using the amended code on a stock Nexus 7 running Android 4.2 trying to open a local web page from my apps internal directory (not assets folder) in web browser. I was wondering has anyone found a way around this that works on 4.2? Dave
Erel B4X founder Staff member Licensed User Longtime User May 23, 2013 #13 Which post are you referring to? Upvote 0
M mistermentality Active Member Licensed User Longtime User May 23, 2013 #14 Erel said: You will need to explicitly set the default browser as the target: Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "1.html")) i.SetComponent("com.android.browser/.BrowserActivity") StartActivity(i) Click to expand... I was referring to this post, sorry. For some reason it will not work, compiles fine but whenever I call it the app errors out. Dave Sent from my Nexus 7 Upvote 0
Erel said: You will need to explicitly set the default browser as the target: Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "1.html")) i.SetComponent("com.android.browser/.BrowserActivity") StartActivity(i) Click to expand... I was referring to this post, sorry. For some reason it will not work, compiles fine but whenever I call it the app errors out. Dave Sent from my Nexus 7
Erel B4X founder Staff member Licensed User Longtime User May 23, 2013 #15 You can use this code to find the correct component: Code: Sub GetBrowserComponent As String Dim pm As PackageManager Dim i As Intent i.Initialize(i.ACTION_VIEW, "http://") Return pm.QueryIntentActivities(i).Get(0) End Sub Upvote 0
You can use this code to find the correct component: Code: Sub GetBrowserComponent As String Dim pm As PackageManager Dim i As Intent i.Initialize(i.ACTION_VIEW, "http://") Return pm.QueryIntentActivities(i).Get(0) End Sub
M mistermentality Active Member Licensed User Longtime User May 23, 2013 #16 Erel said: You can use this code to find the correct component: Code: Sub GetBrowserComponent As String Dim pm As PackageManager Dim i As Intent i.Initialize(i.ACTION_VIEW, "http://") Return pm.QueryIntentActivities(i).Get(0) End Sub Click to expand... Thanks but it returns Chrome as the component, which is great but if I force Chrome to open the page won't the app still fail when on devices without Chrome installed, does this mean there is no way to open a local web page in the default browser that will work across devices? Thanks, Dave Upvote 0
Erel said: You can use this code to find the correct component: Code: Sub GetBrowserComponent As String Dim pm As PackageManager Dim i As Intent i.Initialize(i.ACTION_VIEW, "http://") Return pm.QueryIntentActivities(i).Get(0) End Sub Click to expand... Thanks but it returns Chrome as the component, which is great but if I force Chrome to open the page won't the app still fail when on devices without Chrome installed, does this mean there is no way to open a local web page in the default browser that will work across devices? Thanks, Dave
Erel B4X founder Staff member Licensed User Longtime User May 24, 2013 #17 You should use this method to find the component. You do not need to "hardcode" it. It will work on all devices. Upvote 0
You should use this method to find the component. You do not need to "hardcode" it. It will work on all devices.
M mistermentality Active Member Licensed User Longtime User May 24, 2013 #18 Erel said: You should use this method to find the component. You do not need to "hardcode" it. It will work on all devices. Click to expand... Forgive me sounding a bit dumb here but it says the component us chrome and I thought if chrome is not on a device then it can't call it so would fail? I have used a Webview now but will try it again on different device when can get one. Thanks Dave Sent from my Nexus 7 Upvote 0
Erel said: You should use this method to find the component. You do not need to "hardcode" it. It will work on all devices. Click to expand... Forgive me sounding a bit dumb here but it says the component us chrome and I thought if chrome is not on a device then it can't call it so would fail? I have used a Webview now but will try it again on different device when can get one. Thanks Dave Sent from my Nexus 7
Erel B4X founder Staff member Licensed User Longtime User May 24, 2013 #19 Your code should not include "chrome". You should do something like: Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "1.html")) i.SetComponent(GetBrowserComponent) StartActivity(i) Upvote 0
Your code should not include "chrome". You should do something like: Code: Dim i As Intent i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "1.html")) i.SetComponent(GetBrowserComponent) StartActivity(i)