I have an url in my app like "zoommtg://us04.zoom.com". I want to open it in browser by Intent. As it is not http or https, it can't be parsed by Uri.parse(url)
. Again if I try url="http://"+url;
it works but deletes the ":" from "zoommtg://" resulting wrong url! I am using the solution of this Question
Asked
Active
Viewed 245 times
0

KasRoudra
- 315
- 4
- 8
-
That is not an URL that any browser will be able to handle. If you put this into a browser *manually*, does it work? It looks like Zoom app could handle that. – Generous Badger Jul 15 '21 at 08:15
-
@GenerousBadger Clicking on the link doesn't open zoom app directly. Instead, the link should be opened in browser and then browser will start zoom. – KasRoudra Jul 15 '21 at 09:20
2 Answers
0
if it is working for https
but not other requests, then you can try setting cleartexttraffic
to true in your AndroidManifest.xml
file.
Do tell if that fixes it. :)

mehul bisht
- 682
- 5
- 15
-
src/main/AndroidManifest.xml:14: error: No resource identifier found for attribute 'cleartexttraffic' in package 'android' – KasRoudra Jul 15 '21 at 06:46
0
zoommtg
seems to be "custom protocol" declaration, which isn't resolveable by web browser, but if you are shure, that http(s)
url version will work then just replace scheme
String url = "zoommtg://us04.zoom.com";
url = url.replaceFirst("zoommtg", "https")
if you really need to use unsecure http
then you have to allow app to do such requests, see how to
btw. you still can use Uri
class, it isn't limited to web protocols... check out some description of this structure
URI = scheme:[//authority]path[?query][#fragment]
you can parse your String
to Uri
and just replace scheme
part
Uri.Builder builder = Uri.parse(url).buildUpon();
url = builder.scheme("https").build().toString();

snachmsm
- 17,866
- 3
- 32
- 74