ICode9

精准搜索请尝试: 精确搜索
  • Android:了解如何使用一个具有多个操作的IntentService2019-08-25 23:28:45

    我有一个问题,意图没有在特定的活动流程下交付给IntentService:这是场景: >考虑3个活动,Home,B和C.C有2个片段CF1和CF2. > B,CF1和CF2使用相同的IntentService类但具有不同的操作.>使用startService(Intent)开始IntentService. (片段的getActivity().startService(Intent))>无论Inten

  • java – Android:调用Context.startService()后未启动嵌套的Intent服务2019-08-25 13:02:41

    我的嵌套意图服务定义如下: package com.my.package; ... // Bunch of imports public class MyNotifier ... // Bunch of variables public class MissedCallIntentService extends IntentService { private static final String TAG = "MissedCallIntentSer

  • android – IntentService中的队列大小是否有限制?2019-08-25 11:23:59

    我不太可能遇到任何可能存在的屋顶,但我可能会向IntentService发送大量意图. 我很想知道你可以发送给IntentService的Intent数量是否有上限?队列有大小限制吗?我在文档中找不到任何关于此的内容. 提前致谢解决方法:tl;博士号 来自android源码(API 19): 看起来IntentService只使用绑定

  • IntentService:具体使用2019-08-05 12:08:03

    文章目录1、定义2、作用3、工作流程4、具体使用5、IntentService、Service、Thread 比较 1、定义 Android Service 的封装类。 2、作用 按顺序,在后台执行线程任务,执行完自动关闭服务。 3、工作流程 4、具体使用 public class IntentServiceActivity extends AppCompatA

  • Android Oreo JobIntentService继续在Android 7及以下版本的后台运行,并且经常在Android 8及以上版本中崩溃2019-07-31 04:29:21

    我最近将我的所有服务都替换为前台服务和JobIntentService,因为在oreo及以上版本中有一些后台执行限制(https://developer.android.com/about/versions/oreo/background).根据文档,JobIntentService就像Android 7的Intent Service一样.在下面,就像JobScheduler for Android 8&以上.

  • android – handler.postDelayed在IntentService的onHandleIntent方法中不起作用2019-07-27 14:34:41

    final Handler handler = new Handler(); LOG.d("delay"); handler.postDelayed(new Runnable() { @Override public void run() { LOG.d("notify!"); //calling some methods here } }, 2000); “延迟”确实显示在日志中,但根本不显示.并且在run()中调

  • android – AlarmManager是否要求PendingIntent属于BroadcastReceiver类型?2019-07-25 05:25:29

    AlarmManager的文档似乎暗示(但并不直接明确要求)传入任何set()方法的PendingIntent应该是BroadcastReceiver类型,但我测试了其他组件类型(如IntentService)和它似乎工作正常. 使用0700的非BroadcastReceiver意图是否安全?解决方法:是的,它一直有效,但我怀疑不是你想的那样.您可以将

  • java – 如何每5分钟唤醒我的意图服务2019-07-25 00:35:25

    参见英文答案 > Start Android Service after every 5 minutes                                    3个 我之前知道这个问题,但我没有得到任何答案,我想创建一个始终运行线程的意向服务,但是当我从应用程序退出时,我的服务停止,然后线程也停

  • android – 使用AlarmManager重新安排IntentService – 忽略意图额外信息2019-07-18 08:33:15

    我有一个IntentService,最初是通过点击按钮启动的: Intent intent = new Intent(this, ProximityService.class); intent.putExtra("com.hybris.proxi.triggerTime", 5000l); PendingIntent pendingIntent = PendingIntent.getService(this, 0, intent,

  • android – 如何在Application中通知Activity有关全局变量的变化?2019-07-15 17:23:01

    我有一个IntentService来更新扩展的Application类中的全局变量.在我的几个活动中,我需要知道变量何时发生变化. 我是否必须在所有活动中实施BroadcastReceiver(并从我的服务发送意图)或者是否有更简单的方式来通知我的活动? 谢谢!解决方法:是的,BroadcastReceivers就是为此而设计的.

  • Android:如何在IntentService中获取调用活动的上下文?2019-07-14 22:26:28

    如果我打电话 Intent intent = new Intent(ReadingActivity.this, AdService.class); startService(intent); 从MyActivity类的onCreate方法中,如何从IntentService类的onHandleIntent()方法内部访问MyActivity.this @Override protected void onHandleIntent(Intent arg

  • java – intentservice没有空构造函数,但是有一个构造函数2019-07-14 01:23:22

    我在Activity中有一个IntentService,当我尝试调用该服务时,它会抛出此错误,我发现这很奇怪,因为如果我声明了空构造函数. 错误: 06-17 15:48:34.603: E/AndroidRuntime(13363): FATAL EXCEPTION: main 06-17 15:48:34.603: E/AndroidRuntime(13363): java.lang.RuntimeException: U

  • java – Android SignalR应该实现为Service还是IntentService?2019-07-03 16:11:22

    在我的Android应用程序上,我正在实现SignalR连接(https://github.com/erizet/SignalA)以连接到Hub服务器以发送请求和接收响应. 我的代码示例如下: signalAConnection = new com.zsoft.SignalA.Connection(Constants.getHubUrl(), this, new LongPollingTransport()) { @Overri

  • android – 获取IntentService的进度2019-06-30 13:10:40

    我正在开发一款需要大量API调用的Android应用.我构建了一个实现基于IntentService的排队系统的系统.问题是,我想在IntentService运行时显示准确的ProgressBar更新. 一种方法是将排队系统更改为一系列AsyncTasks.我必须使用onProgressUpdate()显示进度. 另一种方法是调整IntentServi

  • android – 如何取消所有qued for intent Service的待处理意图2019-06-26 11:12:54

    我有一个intentservice,由用户和我的应用程序自动查询.当用户退出我的应用程序时,我需要能够杀死所有挂起的意图,但我似乎无法使其工作.我已经尝试过stopService()和stopself(),但是在用户注销后意图继续触发intentservice.我会尝试获取intent的id,但这很困难,因为每次intentservic

  • android – 如何使WakefulService(IntentService)等到MediaPlayer完成?2019-06-20 17:13:33

    我正在尝试制作一个应用程序,它会在预定的时间使用MediaPlayer播放一系列声音.为了正确处理唤醒锁定并安排播放,我使用了CommonsWare’s WakefulIntentService. 不幸的是,IntentService的工作线程在我调用MediaPlayer.play()后立即退出,并且没有调用MediaPlayer注册的侦听器.而是记

  • android – 等待使用ProgressDialog执行AsyncTask2019-06-14 03:15:30

    我有一个方法public void writeEntry(Activity ctx,Entry entry),它获取一些数据并且必须调用本机方法,这需要更长的时间才能完成. 所以我创建了一个处理ProgressDialog和本机方法的AsyncTask.它在自己的Activity中运行很好来测试它,在Activity中我使用了一个回调接口等等. 在我的

  • android – 如何访问IntentService的队列?2019-05-30 21:15:01

    我有一个活动,它将几个上传进程放入IntentService的队列中.现在我想显示待处理和已启动上传的列表,以及一个停止上传的按钮. 基于这个问题Asking an IntentService for information about its queue我开始实现一个外部队列,但到目前为止我还不知道如何停止一个特定的任务. 有没有更

  • 启动IntentService多次android2019-05-29 10:13:57

    我正在研究一个Android项目,我正在尝试找到一种方法来改进以下代码.我需要知道我开发这个的方式是否合适: > notification是从db重新获取的GCM通知 我的问题是关于我多次打电话的意向服务.好吗?怎么应该改善这个? while (((notification)) != null) {{ message = notification.ge

  • 使用带有Hashmap的对象的Parcelable2019-05-29 09:14:11

    我有一个存储在类中的对象的arrayList,它扩展了intentService.它的对象的实例变量是: int id; String name; HashMap<Long, Double> historicFeedData 我希望能够将此arrayList传递回Activity.我已经读过,当您想要将对象从服务传递到活动时,可以使用Parcelable.我写入包裹的方法如

  • android – 停止IntentService2019-05-18 11:15:32

    有没有人知道是否有一种方法可以在没有完成工作线程并停止自身的情况下停止IntentService? 简单的问题,但我在文档中找不到答案.有一种简单的方法可以阻止它吗? 谢谢解决方法:bevor一个服务的消息被入队onStartCommand被调用.转发消息进行排队.所以你可以覆盖onStartCommand,类似的东

  • android – IntentService:如何正确排队?2019-05-18 11:11:47

    在我的代码中,我使用IntentService来监听位置更新(GPS或网络更新),并在收到事件时触发此IntentService,因此它从任何活动的startService()启动. public class AddLocationService extends IntentService implements LocationListener { /*My code here*/ } @Override pro

  • IntentService2019-04-24 23:43:40

      一、概述 前面讲Service时提及IntentService,这里具体展开进行剖析; IntentService的介绍 IntentService是自己维护了一个线程,来执行耗时的操作,然后里面封装了HandlerThread,能够方便在子线程创建Handler。 IntentService是继承自Service用来处理异步请求的一个基类,客户端startSer

  • 转:Service和IntentService中显示Toast的区别2019-04-19 16:55:34

    转自:https://www.cnblogs.com/dyllove98/archive/2013/07/30/3225944.html 1. 表象       Service中可以正常显示Toast,IntentService中不能正常显示Toast,在2.3系统上,不显示toast,在4.3系统上,toast显示,但是不会消失。   2. 原因       Toast要求运行在UI主线程中。    

  • Android多线程:IntentService用法&源码分析2019-03-09 19:48:53

    版权声明:本文为博主原创文章,未经博主允许不得转载,更多请继续关注Carson_Ho https://blog.csdn.net/carson_ho/article/details/53407806 前言 多线程的应用在Android开发中是非常常见的,常用方法主要有: 继承Thread类 实现Runnable接口 AsyncTask Handler HandlerThr

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有