调用Microsoft Azure API时出错
问题描述:
String api =“notificationregistration?handle =”+ libFile.getDeviceToken();调用Microsoft Azure API时出错
mClient.invokeApi(api, null, "POST", null, new ApiJsonOperationCallback()
{
@Override
public void onCompleted(JsonElement jsonElement, Exception e, ServiceFilterResponse serviceFilterResponse)
{
if(e == null)
{
try
{
String registrationId = jsonElement.toString().replaceAll("\"","");
if(AppConstants.DEBUG) Log.v(AppConstants.DEBUG_TAG, "NOTIFICATION REGISTRATION ID : "+registrationId);
}
catch (Exception e1)
{
e1.printStackTrace();
}
}
else
{
e.printStackTrace();
}
}
});
错误:
Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
at com.microsoft.windowsazure.mobileservices.http.MobileServiceConnection$1.onNext(MobileServiceConnection.java:128)
at com.microsoft.windowsazure.mobileservices.MobileServiceClient$15.handleRequest(MobileServiceClient.java:1499)
at com.microsoft.windowsazure.mobileservices.http.MobileServiceConnection.start(MobileServiceConnection.java:113)
at com.microsoft.windowsazure.mobileservices.http.RequestAsyncTask.doInBackground(RequestAsyncTask.java:78)
at com.microsoft.windowsazure.mobileservices.http.RequestAsyncTask.doInBackground(RequestAsyncTask.java:35)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
答
有在你的代码的任何明显的问题。根据错误信息,它似乎在Android设备上启用飞行模式。是吗?请检查并重试。
或者某些第三方库可能会导致此问题,如其他SO线程Why I have "Setting airplane_mode_on has moved from android.provider.Settings.System [...]" into the logcat when my app has nothing to do with that?所作。
它似乎是来自logcat的错误堆栈的内容,但不清楚解决您的问题。请发布更多有关改进内容的详细信息,例如您调用的Azure API,一些关键代码和说明,您的问题等。 –
@ PeterPan-MSFT请检查更新的问题 –