草庐IT

SERVICE_CONTROL_POWEREVENT

全部标签

java - 无法解析 : firebase-analytics failed to resolve:play-service-base

这个问题在这里已经有了答案:Gradlebuildtoolcannotfindplay-services-tasks.aar?Why?(8个答案)关闭4年前。帮助我解决我的gradle中的那些错误。错误:Warning:Configuration'androidTestCompile'isobsoleteandhasbeenreplacedwith'androidTestImplementation'and'androidTestApi'.Itwillberemovedattheendof2018.Formoreinformationsee:http://d.android.com/r

android - 在 Activity 和 Service 之间共享首选项

我有一个.apk,它有一个Service和一个Activity,我想共享它。我想我使用getSharedPreferences("somename",MODE_PRIVATE)来做到这一点。不过有几个问题:MODE_PRIVATE可以吗?这是否意味着它对于应用程序或Activity/服务是私有(private)的?我有一个PreferenceActivity。我如何告诉它管理“somename”而不是默认首选项?谢谢! 最佳答案 MODE_PRIVATE:文件创建模式:默认模式,创建的文件只能由调用应用程序(或共享相同用户ID的所有

android - Monodroid Intent Service 的 BroadcastReceiver 没有触发 OnReceive

我一直在尝试为monodroid运行玩具Intent服务essentiallygoingoffofthissourcematerial我一直遇到一些问题,我已经将其归结为广播接收器。最让我怀疑的是ACTION_RESP字符串。如果没有别的,我当然可以忍受,也许可以确认这一点,也许是设置接收者可以看到的Action的正确方法。所以,这就是我到目前为止所拥有的...我的意向服务usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingAndroid.App;usingAndroid.

android - 谷歌 GDK : Differences in calling app with voice trigger or menu affecting camera service?

我正在尝试创建一个使用相机服务来显示预览的GlassGDK应用程序。不幸的是,我目前有一个错误,在尝试使用Camera.open()打开相机时抛出RuntimeException。我只在通过语音触发器打开Activity时遇到此错误,而不是通过从“启动器”菜单中选择应用程序。通过此菜单启动Activity的方式与通过语音触发器启动的方式有区别吗?部分相关代码如下。@OverridepublicvoidonCreate(BundlesavedInstanceState){mGestureDetector=createGestureDetector(this);super.onCreate

android - (AudioManager)getSystemService(Context.AUDIO_SERVICE) 导致内存泄漏

我遇到了由AudioManager引起的内存泄漏。所以我在我的代码中注释掉了这一行,看看它是否能解决我的问题:publicclassFireRoomActivityextendsActivity{AudioManageram;protectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);am=(AudioManager)getSystemService(Context.AUDIO_SERVICE);}}它确实解决了问题,我不再有内存泄漏。是因为Context.AUDIO_SERVIC

java - 安卓 5.0 IllegalArgumentException : Service Intent must be explicit: on com. google.android.location.internal.GoogleLocationManagerService.START

我正在尝试检索在我的Activity中调用LocationClient类的方法connect的设备的位置,但是当进行调用时系统崩溃以下异常:**FATALEXCEPTION:mainProcess:com.unipagossales,PID:3833java.lang.RuntimeException:UnabletostartactivityComponentInfo{com.unipagossales/com.unipagossales.app.merchants.MerchantFragmentActivity}:java.lang.IllegalArgumentExceptio

Youtube 上的 Android SERVICE_MISSING 错误消息

嗨,我已经用我的json完成了相同的应用程序。我在模拟器上看到的videoView中的问题是“初始化youtube播放器时发生错误..注意:list中已提供互联网权限我试图追踪错误publicvoidonInitializationFailure(YouTubePlayer.Providerplayer,YouTubeInitializationResulterrorReason){//TODOAuto-generatedmethodstubStringerrorMessage=errorReason.toString();Toast.makeText(this,errorMessag

android - 如何让我的 Android 应用程序使用 "Service Account"访问共享的 Google 日历?

我认为答案是肯定的,但我不确定该怎么做。我一直在使用API从设备上存储的日历中获取事件。例如publicstaticArrayListqueryEvents(longstartMillis,longendMillis)throwsMINPermissionException{if(ContextCompat.checkSelfPermission(MINMainActivity.getSharedInstance(),Manifest.permission.WRITE_CALENDAR)!=PackageManager.PERMISSION_GRANTED){thrownewMINPe

android - 使用 JobScheduler 代替 BroadcastReceiver 和 Service

我正在开发一个应用程序,当设备连接到互联网时,它将在后台按顺序将我所有的数据库记录上传到服务器。为此,我编写了一个BroadcastReceiver来监听网络连接。触发此接收器后,我将启动用于上传记录的后台服务。这是我的代码。publicclassNetworkChangeReceiverextendsBroadcastReceiver{@OverridepublicvoidonReceive(finalContextcontext,finalIntentintent){AppUtils.checkInternetConnection(context));//Ifthedeviceha

android - Activity 和 Service 是否在同一个线程中运行?

我对处理程序、服务和Activity的基本概念有些困惑。我在很多地方看到提到服务在UI线程中运行。关于这份声明,我有几个问题。以上说法是真是假?有人可以从服务的android引用中解释这个声明AServiceisnotathread.Itisnotameansitselftodoworkoffofthemainthread(toavoidApplicationNotRespondingerrors).如果服务在UI线程中运行,则它不适合繁重的工作。对/错??如果没有Activity运行,那么哪个线程服务将运行??如果上述陈述为真。如果上面的说法是真的?那么如果我在服务和Activity