草庐IT

existing_start

全部标签

android - java.lang.RuntimeException : start failed at android. media.MediaRecorder.start( native 方法)

我正在处理通话记录。当我开始录制一个电话时,不幸的是它停止了。&它给出错误MediaRecorder启动失败-2147483648。请告诉我我的代码有什么问题?这是我的代码。publicclassincomingcallextendsBroadcastReceiver{Contextc;MediaRecorderrecorder;publicincomingcall(){}@OverridepublicvoidonReceive(Contextcontext,Intentintent){c=context;try{PhoneStateChangeListenerpscl=newPhon

android - 我需要多次调用 Crashlytics.start 吗?

我刚刚在Crashlytics上添加了我的应用程序.我将APIkey放在AndroidManifest.xml文件中,然后在启动器ActivityonCreate()方法中调用Crashlytics.start(this).我有+20个Activity和20个fragment。我是否需要将Crashlytics.start(this)放入每个Activity的onCreate()方法中,以使Crashlytics能够跟踪我的整个应用程序? 最佳答案 摘自CrashalyticsSDK常见问题解答:IfyouhaveanApplica

android - 服务在应用程序关闭时重新启动 - START_STICKY

我有一个作为网络服务器运行的应用程序。该应用有一项服务是START_STICKY我希望该服务始终运行网络服务器(在通知中向用户提供了停止它的选项)。问题是当我关闭我的应用程序时,服务器会重新启动(丢失设置等)。它保持在那里很好,但logcat显示它正在重新启动。我可以重新打开我的应用程序并绑定(bind)到新服务,一切正常。虽然再次滑动关闭具有相同的效果。我需要这个才能不重启。标准服务代码privateWebServerServicemService;privateServiceConnectionmConnection=newServiceConnection(){@Override

android - ?安卓 :attr/selectableItemBackground with another existing background

我将9patch设置为布局的背景。但是我仍然想通过使用selectableItemBackground来提供触摸反馈。属性。我试过使用使用9patch和selectableItemBackground作为android:drawable第二个,但是那没有用。我也可以尝试制作一个选择器并覆盖android用于selectableItemBackground的渐变可绘制对象在list_selector_background_pressed.xml用.但是在4.4KitKat中,选择的背景颜色实际上是灰色而不是JellyBeans中的蓝色,所以我不能真的硬编码:(必须有更简单的方法,对吗?D

android - 相机 AF_TRIGGER_START 没有开始关注 Touch

我有一个使用camera2Api的相机应用程序,我在用于从相机预览的TextureView上实现了onTouchListener,我想要的是当用户点击屏幕时能够像内置的Android相机一样专注于该区域.我不知道出了什么问题,当我使用AF_MODE_AUTO时它可以工作,但它不精确,它只聚焦屏幕中心的内容。这是我的代码:mTextureView.setOnTouchListener(newView.OnTouchListener(){@OverridepublicbooleanonTouch(Viewv,MotionEventevent){switch(event.getAction(

android - java.lang.IllegalArgumentException : column'_data' does not exist 异常

publicstaticStringgetFilePathFromUri(Uriuri,Contextc){try{StringfilePath=null;Stringscheme=uri.getScheme();if(scheme!=null&&scheme.equals("content")){ContentResolvercontentResolver=c.getContentResolver();Cursorcursor=contentResolver.query(uri,null,null,null,null);cursor.moveToFirst();filePath=cu

Cannot deserialize instance of `java.util.ArrayList` out of START_OBJECT token错误解决

Postman调试时报错:Cannotdeserializeinstanceof`java.util.ArrayList`outofSTART_OBJECTtoken。原因:需要的是集合,但是传入的参数外面包装了一个对象。publicMapaddAddress(@RequestBodyListrecords){​​​​​​​}解决方式:把对象用数组的格式进行传递。[{"id":"606863377499837444","createdBy":"601157755265372302","created":"2023-06-0214:59:14","lastUpdated":"2023-06-02

android - Xamarin Android 播放器/Visual Studio : Stuck at "Starting Emulator"

使用VisualStudio和XamarinAndroidPlayer(XAP),我突然无法将我的应用程序部署到模拟设备。整个调试过程在尝试启动设备时卡住了,大约一个小时后,就再也没有进展了。模拟器本身确实启动了,并且运行良好。有趣的是,当设备运行时,VisualStudio将其列为不受支持的设备,甚至不会尝试部署到它:我曾尝试在XamarinStudio和VisualStudio中运行此项目和其他项目,但均无济于事。我还尝试更新/全新安装XAP、VirtualBox、JDK和AndroidSDK/NDK。关于如何让XAP重新工作有什么想法吗? 最佳答案

java - "Thread already started"恢复 Activity 时

这是我的情况:我正在为android构建一个游戏,我的游戏Activity由一个自定义surfaceView组成,它有一个用于游戏逻辑和渲染的线程。该架构类似于Google网站上的LunarLander演示。当Activity开始时,它会创建surfaceView并调用此方法:@OverridepublicvoidsurfaceCreated(SurfaceHolderholder){renderThread.start();}当我按下home键退出游戏时,会调用onPause()方法,调用surfaceDestroyed()。在surfaceDestroyed中,我通过调用停止游戏线

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