草庐IT

illegalArgumentException

全部标签

java - 安卓:java.lang.IllegalArgumentException:服务未注册

我有启动服务并绑定(bind)它的Activity。但是我希望即使Activity关闭我的服务也能运行,所以我需要解除绑定(bind)。当我尝试这样做时(调用我的函数disconnectFromService),我总是得到这个异常。服务已成功绑定(bind),我可以与其通信。只有在绑定(bind)时我才尝试解除绑定(bind)服务。我想,我尝试从相同的上下文绑定(bind)和解除绑定(bind)服务-这个-调用绑定(bind)和解除绑定(bind)来自MainActivity函数。主要Activity:publicclassMainActivityextendsAppCompatAct

android - java.lang.IllegalArgumentException : We already have an EditText, 只能有一个

错误:07-1916:39:56.80629207-29207/ch.android.mdE/AndroidRuntime﹕FATALEXCEPTION:mainjava.lang.RuntimeException:UnabletostartactivityComponentInfo{ch.swissfm.md/ch.swissfm.md.Login}:java.lang.IllegalArgumentException:WealreadyhaveanEditText,canonlyhaveoneatandroid.app.ActivityThread.performLaunchAct

安卓 MediaExtractor readSampleData IllegalArgumentException

我试着回答这个问题Concatenatemultiplemp4audiofilesusingandroid´sMediaMuxer并连接视频文件。但由于某些原因,当我调用readSampleData时,MediaExtractor抛出IllegalArgumentException在官方API中,这个函数根本不应该抛出任何异常!这是怎么回事?我发现一个老问题表明ByteBuffer的大小可能是负责的:AndroidMediaMuxerreadSampleDataIllegalStateException我已经尝试了很多大小值,但没有一个能解决问题。有我应该知道的标准尺寸吗?任何提示都有

java - Robolectric 给我一个 java.lang.IllegalArgumentException : INTERNET permission is required

我正在为现有应用改造单元测试。当我运行这个简单的单元测试时importorg.junit.Test;importorg.junit.runner.RunWith;importorg.robolectric.RobolectricGradleTestRunner;importorg.robolectric.annotation.Config;importstaticjunit.framework.Assert.assertTrue;@RunWith(RobolectricGradleTestRunner.class)@Config(constants=BuildConfig.class,

android - java.lang.IllegalArgumentException 由于 Spannable TextView

我在我的GooglePlay控制台中收到了这份崩溃报告,我自己从未遇到过,也无法重现。java.lang.IllegalArgumentException:atandroid.text.method.WordIterator.checkOffsetIsValid(WordIterator.java:380)atandroid.text.method.WordIterator.isBoundary(WordIterator.java:101)atandroid.widget.Editor$SelectionStartHandleView.positionAtCursorOffset(Ed

Android:调用 onStop() 时为 `java.lang.IllegalArgumentException: Service not registered`

我有一个应用程序绑定(bind)到一个长期运行的服务。我需要确保当用户离开Activity时,Service会停止。因此我实现了onStop()来关闭服务:代码如下:@OverrideprotectedvoidonStop(){super.onStop();if(mService!=null)mService.stop();stopService(newIntent(this,LocalService.class));unbindService(mConnection);stopService(intent);}这是我的LogCat:02-2211:42:44.393:E/Androi

android - 为什么用inBitmap解码位图总是得到java.lang.IllegalArgumentException : P ro blem decoding into existing bitmap

我正在使用inBitmap在android3+上加载位图。但我总是得到java.lang.IllegalArgumentException:Problemdecodingintoexistingbitmap.在LruCache的entryMoved()功能:我使用reusableBitmaps.add(newSoftReference(oldValue.getBitmap()));保留位图。下次加载位图:我在reusableBitmaps上使用迭代器来查找我可以将哪个用于inBitmap,我使用迭代器来查找哪一个,就像在官方开发者网站上管理内存一样。但不幸的是,总是失败,logcat显

android - java.lang.illegalargumentexception url 中的非法字符

我想请求网络服务我的参数是这样的urlString=http://ip/autodownload/andro.php?key=apps.apk|2|bla.bla.blapublicvoidgetRequest(StringUrl){Toast.makeText(this,"TambahData"+Url+"",Toast.LENGTH_SHORT).show();HttpClientclient=newDefaultHttpClient();HttpGetrequest=newHttpGet(urlString);try{System.out.println("tes");HttpR

android - java.lang.IllegalArgumentException : Illegal URL with retrofit 异常

我正在尝试在我的应用程序中调用一个API我有以下网址模板test-test.domainname.com/feeds/json/v3/attribute/attribute我正在使用改造2但我得到以下致命异常IllegalURL:test-test.domainname.com这是我的界面publicinterfaceIinterface{@GET("feeds/json/v3/attribute/"+attribute)Call>getresult();}谁能帮我解决这个问题... 最佳答案 我的基本URL在这里:http://m

java - IllegalArgumentException:文件包含路径分隔符 Android

我正在尝试写入HTCOne上的输出文件并在LogCat中收到以下消息:11-2108:05:18.228:W/System.err(6609):java.lang.IllegalArgumentException:File/storage/emulated/0/com.example.pattern1/myfile.txtcontainsapathseparator源码如下:protectedvoidwriteToFile(Stringstring){FilepatternDirectory=newFile(Environment.getExternalStorageDirectory