调用Microsoft Azure API时出错

时间:2017-03-16 07:29:16

标签: android azure

String api =“notificationregistration?handle =”+ libFile.getDeviceToken();

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)

1 个答案:

答案 0 :(得分:0)

您的代码中存在任何明显的问题。只是根据错误信息,似乎在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?