我有一个简单的android程序,类似于windowsazuremobileservices中的todoactivity,每当我接到来电时,应用程序会在通话结束但未关闭程序时抛出异常。有人能告诉我怎么阻止这一切吗?
这是洛格特正在扔的东西:

10-02 12:32:17.682: W/System.err(6314): com.microsoft.windowsazure.mobileservices.MobileServiceException: Error while processing request.
10-02 12:32:17.757: W/System.err(6314):     at com.microsoft.windowsazure.mobileservices.MobileServiceConnection$1.onNext(MobileServiceConnection.java:122)
10-02 12:32:17.757: W/System.err(6314):     at com.creative.connection.timeschedulr.DisplayContentActivity$ProgressFilter.handleRequest(DisplayContentActivity.java:819)
10-02 12:32:17.757: W/System.err(6314):     at com.microsoft.windowsazure.mobileservices.MobileServiceConnection.start(MobileServiceConnection.java:93)
10-02 12:32:17.757: W/System.err(6314):     at com.microsoft.windowsazure.mobileservices.RequestAsyncTask.doInBackground(RequestAsyncTask.java:77)
10-02 12:32:17.757: W/System.err(6314):     at com.microsoft.windowsazure.mobileservices.RequestAsyncTask.doInBackground(RequestAsyncTask.java:1)
10-02 12:32:17.757: W/System.err(6314):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
10-02 12:32:17.757: W/System.err(6314):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
10-02 12:32:17.757: W/System.err(6314):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
10-02 12:32:17.757: W/System.err(6314):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
10-02 12:32:17.757: W/System.err(6314):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
10-02 12:32:17.757: W/System.err(6314):     at java.lang.Thread.run(Thread.java:1019)
10-02 12:32:17.757: W/System.err(6314): Caused by: java.net.UnknownHostException: scheduler.azure-mobile.net
10-02 12:32:17.768: W/System.err(6314):     at java.net.InetAddress.lookupHostByName(InetAddress.java:516)
10-02 12:32:17.768: W/System.err(6314):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
10-02 12:32:17.768: W/System.err(6314):     at java.net.InetAddress.getAllByName(InetAddress.java:256)
10-02 12:32:17.768: W/System.err(6314):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
10-02 12:32:17.768: W/System.err(6314):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
10-02 12:32:17.768: W/System.err(6314):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
10-02 12:32:17.768: W/System.err(6314):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
10-02 12:32:17.768: W/System.err(6314):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
10-02 12:32:17.768: W/System.err(6314):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
10-02 12:32:17.768: W/System.err(6314):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
10-02 12:32:17.768: W/System.err(6314):     at android.net.http.AndroidHttpClient.execute(AndroidHttpClient.java:243)
10-02 12:32:17.768: W/System.err(6314):     at com.microsoft.windowsazure.mobileservices.ServiceFilterRequestImpl.execute(ServiceFilterRequestImpl.java:71)
10-02 12:32:17.772: W/System.err(6314):     at com.microsoft.windowsazure.mobileservices.MobileServiceConnection$1.onNext(MobileServiceConnection.java:102)
10-02 12:32:17.772: W/System.err(6314):     ... 10 more

最佳答案

似乎是由于应用程序当时无法访问您的移动服务而引发错误,如下面所述:
原因:java.net.unknownhostexception:scheduler.azure-mobile.net
如果你能重现这一点,我非常怀疑它与移动服务或sdk有关,而不是与你设备上的网络可用性有关。如果无法从应用程序内部看到抛出错误的位置(即触发网络请求的内容),很难准确地说出可能导致此错误的原因。我唯一的假设是,当设备由于电话呼叫而仍然没有任何网络连接时,您以某种方式触发了网络请求。如果你能提供准确的步骤来重现和触发网络请求的是什么,我也许可以深入研究。

10-06 14:00