我使用本教程创建了一个地图:https://developer.mapquest.com/documentation/android-sdk/ 它在2个月前运行良好,现在我收到了错误:
W / com.mapbox.mapboxsdk.http.HTTPRequest:由于永久性错误导致请求失败
答案 0 :(得分:1)
解决方案是通过 MapboxAccountManager (使用Mapbox网页中的API密钥而不是MapQuest网页)更改 MapQuestAccountManager ,而不是调用 setContentView(R.layout) MapboxAccountManager
之前的.activity_main_mr);public class MainActivityMR extends Activity {
private MapboxMap mMap;
private MapView mMapView;
private String linkid ="";
private String evento ="";
String latpass;
String lonpass;
String vod;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_main_mr);
//MapQuestAccountManager.start(getApplicationContext());
//MapboxAccountManager.start(this, getString(R.string.access_token));
MapboxAccountManager.start(getApplicationContext(), getString(R.string.access_token));
setContentView(R.layout.activity_main_mr);
从https://www.mapbox.com/studio/account/tokens/获取您的API密钥 并将此行添加到strings.xml
<string name="access_token">YOUR_API_KEY</string>