打开https连接(距离矩阵api)

打开https连接(距离矩阵api),https,google-distancematrix-api,Https,Google Distancematrix Api,我正在尝试使用谷歌距离矩阵api 我通过截击请求使用此url,我得到一个截击错误(onErrorResponse): 我尝试使用如下意图打开url: Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); 但我得到了这个错误: android.content.ActivityNotFoundException: No Activity found to handle Inte

我正在尝试使用谷歌距离矩阵api

我通过截击请求使用此url,我得到一个
截击错误(onErrorResponse)

我尝试使用如下意图打开url:

Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
但我得到了这个错误:

android.content.ActivityNotFoundException: No Activity found to handle
Intent { 
    act=android.intent.action.VIEW
    dat=https://maps.googleapis.com/maps/api/distancematrix/json?
        origins=Hai Si Redouane, Oran
        &destinations=Place Premier November 1954, Oran, Algeria
        &key=API-KEY 
}

注意:我使用的是真正的设备,当我从浏览器打开url时,url工作正常

我确实记得您对同一个问题发表了评论。您尝试访问的url不返回HTML内容,而是返回JSON数据。试着用那种方式来解决这个问题,我用截击的方式解决了这个问题,我得到了一个截击错误。。。问题是,url根本不会从应用程序打开,但会从浏览器正常打开。。。也。。我使用谷歌方向网络api,它的工作很好。。。现在的浏览器能够显示JSON数据,但这并不能让它成为一个网页来访问这些问题。它解决了您所面临的相同问题
android.content.ActivityNotFoundException: No Activity found to handle
Intent { 
    act=android.intent.action.VIEW
    dat=https://maps.googleapis.com/maps/api/distancematrix/json?
        origins=Hai Si Redouane, Oran
        &destinations=Place Premier November 1954, Oran, Algeria
        &key=API-KEY 
}