本文介绍了在某些设备上抛出java.lang.UnsupportedOperationException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我发现,我的应用程序,使用yandex地图套件,在某些设备上崩溃有这样的例外。这个java.lang.UnsupportedOperationException异常是什么意思?
I've found out, that my app, that uses the yandex map kit, on some devices crashes with such an exception. What does this "java.lang.UnsupportedOperationException" exception means???
06-26 16:25:06.301: ERROR DeviceIdProvider(3174): UNKNOWN ID QUERY content://ru.yandex.device.id.maps/device_id id -1
06-26 16:25:06.301: ERROR/DatabaseUtils(3174): Writing exception to parcel
java.lang.UnsupportedOperationException: query: Not supported yet - content://ru.yandex.device.id.maps/device_id
at ru.yandex.core.device.id.DeviceIdProvider.query(SourceFile:80)
at android.content.ContentProvider$Transport.query(ContentProvider.java:178)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
at android.os.Binder.execTransact(Binder.java:338)
at dalvik.system.NativeStart.run(Native Method)
06-26 16:25:06.511: ERROR/dalvikvm(533): GC_FOR_ALLOC freed 2221K, 41% free 9496K/16035K, paused 7ms+22ms
06-26 16:25:06.781: ERROR/AndroidRuntime(3690): FATAL EXCEPTION: AsyncTask #3
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:278)
at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
Caused by: java.lang.NullPointerException
at com.shop.pagerFragments.TorgCentrMapFragment$SetRightMapDisplayAddress.doInBackground(TorgCentrMapFragment.java:419)
at com.shop.pagerFragments.TorgCentrMapFragment$SetRightMapDisplayAddress.doInBackground(TorgCentrMapFragment.java:401)
at android.os.AsyncTask$2.call(AsyncTask.java:264)
at java.util.
concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
... 4 more
这是doInBackground方法:
Here is the doInBackground method:
private class SetRightMapDisplayAddress extends AsyncTask<String, Void, List<Address>> {
@Override
protected List<Address> doInBackground(String... params) {
Log.d(TAG, "doinbackground SetRightMapDisplayAddress started");
long startTime= System.currentTimeMillis();
long threadId = Thread.currentThread().getId();
Log.d(TAG, String.format("The thread id is: %d", threadId));
context = getActivity();
String placeName = params[0];
Geocoder geocoder = new Geocoder(context);
List<Address> addressList = null;
try {
addressList = geocoder.getFromLocationName(placeName, 3);
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
int returnedAddresses = addressList.size();
Log.d(TAG, String.valueOf(returnedAddresses));
long endTime = System.currentTimeMillis();
Log.d(TAG, String.valueOf(startTime-endTime));
Log.d(TAG, "doinbackground SetRightMapDisplayAddress ended");
return addressList;
}
提前感谢您的回答!!
Thanks in advance for your answers!!
推荐答案
根据异常描述,我可以建议框架作者尚未实现该方法,因此您可能会联系支持小组澄清。
Based on the exception description, I can suggest that the method isn't implemented yet by the framework authors, so you might contact the support team for clarifications.
这篇关于在某些设备上抛出java.lang.UnsupportedOperationException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!