草庐IT

case-when

全部标签

android - 同步时出错 : timeout when deploying apk to device using maven

我正在使用mavenandroid插件构建我的项目并将它们部署到设备。使用mvncleaninstallandroid:undeployandroid:deploy我可以成功部署到我的2.2ZTEblade:[INFO]Found1devicesconnectedwiththeAndroidDebugBridge[INFO]android.deviceparameternotset,usingallattacheddevices[INFO]Successfullyuninstalledcom.jameselsey.appsfromP729J_SBM_ZTE_ZTE-BLADE[INFO

android - '非法状态异常 : Activity has been destroyed' when 'getSupportFragmentManager()' called after Activity restart

我有一个父fragmentActivity,它有一个包含子ViewPager的ViewPager。子ViewPager包含每个页面的fragment。我使用回调接口(interface)在这些子页面fragment和顶级父fragmentActivity之间进行通信,例如publicinterfaceCallbacks{publicvoidonItemSelected(Linklink);}在父fragmentActivity中,我监听onItemSelected事件,例如@OverridepublicvoidonItemSelected(Linklink){Bundleargumen

安卓 8.0 : IllegalBlocksizeException when using RSA/ECB/OAEPWithSHA-512AndMGF1Padding

我通常会在这里找到大部分问题的答案,但这次我需要问:-)。我们在Android8.0(API级别26)上运行的一个应用程序中遇到了RSA加密/解密问题。我们一直在将RSA与“RSA/ECB/OAEPWithSHA-256AndMGF1Padding”一起使用,它在Android7.1之前的所有版本上都能正常工作。在Android8.0上运行的相同代码在调用Cipher.doFinal()时抛出IllegalBlocksizeException。这里是重现问题的代码:privateKeyStoremKeyStore;privatestaticfinalStringKEY_ALIAS="M

Android Spinner - How to position dropdown arrow as close to text as possible when options have different length?

我的微调器中的选项有不同的长度,目前下拉箭头根据最长的选项定位在最右边,如下面的屏幕截图所示。是否可以移动下拉箭头,使其根据当前选择的选项动态定位?特别是当第一个选项只是“全部”时,当下拉箭头离右边太远时看起来很奇怪。引用谷歌翻译应用程序,其中下拉箭头始终位于其文本旁边: 最佳答案 您无法控制原始下拉图标的位置,唯一的方法是禁用默认图标并将您自己的图标添加到下拉列表中。首先,通过将Spinner的背景设置为@null来禁用默认下拉图标:然后创建一个只有一个TextView的布局资源spinner_item_main.xml,我们可以

android - 非法参数异常 : column '_id' does not exist when call to SimpleCursorAdaptor

我有一个名为“master”的表,其中包含id、name、surname、gender和指定当我启动查询以获取Cursor时CursorAdapter的对象我得到:IllegalArgumentException:column'_id'doesnotexistwhencalltoCursorAdaptor但我没有名为“_id”的列。谁能告诉我为什么会出现此错误?这是堆栈跟踪:07-1315:45:40.582:WARN/System.err(295):java.lang.IllegalArgumentException:column'_id'doesnotexist07-1315:45

android - 无法解析 : support-fragment error when add google architecture component dependency

我想在我的应用程序中使用Google架构组件,但是在将androidstudio更新到版本3.1.1之后,我将android.arch.lifecycle:extensions:1.1.1依赖项添加到app.gradle中文件,它将显示Failedtoresolve:support-fragment我的gradle版本是4.4这是应用程序gardle:applyplugin:'com.android.application'android{compileSdkVersion27defaultConfig{applicationId"ir.apptori.myapplication"mi

android - 我打开失败 : EACCES (Permission denied) error when I try write data to SD card in Android 5. 1,为什么?

我需要保存一些数据到SD卡,我已经添加了权限到AndroidManifest.xml文件,在Android4.12mobile上测试可以得到正确的结果。但我在Android5.1移动设备上测试它时出现openfailed:EACCES(Permissiondenied)错误,为什么?顺便说一句,我已经阅读了文章Android6.0openfailed:EACCES(Permissiondenied)和Exception'openfailed:EACCES(Permissiondenied)'onAndroid,但现在我的手机是三星Android5.1代码privatevoidActio

android - BufferQueue 已被放弃 : When playing video with TextureView

每次我暂停我的Activity(实际上是Fragment)以转到另一个应用程序时,在使用onResume返回时我尝试恢复视频播放但它不播放:我得到一个空白屏幕。经调查,我在Logcat中看到以下内容E/BufferQueueProducer:[unnamed-23827-0]queueBuffer:BufferQueuehasbeenabandonedE/MediaPlayer:error(1,-38)E/MediaPlayer:error(1,-38)E/MediaPlayer:error(1,-38)E/MediaPlayer:error(1,-38)E/BufferQueuePr

android - Dagger 2 : Error when two components has same inject method signature

我有这个组件:@Singleton@Component(modules=OauthModule.class)publicinterfaceOauthComponent{voidinject(LoginActivitya);}和模块:@ModulepublicclassOauthModule{@Provides@SingletonOauth2ServiceprovideOauth2Service(){returnnewOauth2StaticService();}}这是另一个组件:@Singleton@Component(modules=LoggedUserModule.class)pu

android - AudioFlinger(59) : RecordThread: buffer overflow when Activity is paused?

我有一个应用程序,它由一个服务和一个Activity组成,该Activity可能由该服务针对某些事件启动。该服务可以创建和使用AudioRecord和AudioTrack类——此时显示应用程序的Activity。问题是如果Activity暂停(即调用onPause())我开始收到RecordThread:缓冲区溢出错误?我的猜测是AudioRecorder在主线程中运行。而且,即使它是由服务创建的,当Activity暂停读取时缓冲区也会溢出?AudioRecorder读取是否必须在单独的线程中完成,即使它正在服务中运行?非常感谢任何帮助,谢谢。 最佳答案