本文整理了Java中android.app.IntentService
类的一些代码示例,展示了IntentService
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IntentService
类的具体详情如下:
包路径:android.app.IntentService
类名称:IntentService
暂无
代码示例来源:origin: leolin310148/ShortcutBadger
@Override
public void onCreate() {
super.onCreate();
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
}
代码示例来源:origin: guolindev/booksource
@Override
public void onDestroy() {
super.onDestroy();
Log.d("MyIntentService", "onDestroy executed");
}
代码示例来源:origin: leolin310148/ShortcutBadger
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
}
代码示例来源:origin: pmbento/karmadetector
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
super.onStartCommand(intent, flags, startId);
return START_STICKY;
}
代码示例来源:origin: majido/clipper
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
super.onStartCommand(intent, flags, startId);
return START_STICKY;
}
代码示例来源:origin: square/leakcanary
@Override
public void onCreate() {
super.onCreate();
showForegroundNotification(100, 0, true,
getString(R.string.leak_canary_notification_foreground_text));
}
代码示例来源:origin: square/leakcanary
@Override public void onDestroy() {
super.onDestroy();
stopForeground(true);
}
代码示例来源:origin: nshmura/strictmode-notifier
@Override public int onStartCommand(Intent intent, int flags, int startId) {
super.onStartCommand(intent, flags, startId);
return START_STICKY;
}
代码示例来源:origin: nickbutcher/plaid
@Override
public void onStart(@Nullable Intent intent, int startId) {
super.onStart(intent, startId);
Injector.inject(this);
}
代码示例来源:origin: TeamNewPipe/NewPipe
@Override
public void onCreate() {
super.onCreate();
startForeground(ID, createNotification().build());
}
代码示例来源:origin: TeamNewPipe/NewPipe
@Override
public void onDestroy() {
super.onDestroy();
stopForeground(true);
if (fetcher != null) fetcher.dispose();
}
代码示例来源:origin: baidu/GPT
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
/*
* deleted by caohaitao 20150902
* 由于需求不在使用这种setforeground的方式。因为产品上很难接受。
* 所以service采用 deliver intent sticky 模式。被杀死后重启,然后继续完成任务。
* 去host读取meta里面的接口,判断是否要前台显示
IInstallerNotificationCreator creator = null;
Object obj = Util.getHostMetaDataClassInstance(getApplicationContext(),
IInstallerNotificationCreator.MATA_DATA_NOTI_CREATOR_CLASS);
if (obj instanceof IInstallerNotificationCreator) {
if (DEBUG) {
Log.d(TAG, "host IInstallerNotificationCreator class : " + obj.getClass().getName());
}
creator = (IInstallerNotificationCreator) obj;
}
if (creator != null) {
startForeground(IInstallerNotificationCreator.INSTALLER_NOTI_ID,
creator.createNotification(getApplicationContext()));
}
*/
return super.onStartCommand(intent, flags, startId);
}
代码示例来源:origin: baidu/GPT
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
}
代码示例来源:origin: grandcentrix/tray
@Override
public void onCreate() {
super.onCreate();
mTrayPreferences = new AppPreferences(this);
mSharedPreferences = getSharedPreferences(SampleActivity.SHARED_PREF_NAME,
Context.MODE_MULTI_PROCESS);
}
代码示例来源:origin: cSploit/android
@Override
public void onDestroy() {
finishNotification();
super.onDestroy();
}
}
代码示例来源:origin: tianzhijiexian/Logcat
@Override
public int onStartCommand(@Nullable Intent intent, int flags, int startId) {
mIsRunning = true;
return super.onStartCommand(intent, flags, startId);
}
代码示例来源:origin: chuyangliu/tastysnake
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
Log.d(TAG, "onStart() called");
}
代码示例来源:origin: robolectric/robolectric
@Override
public void onCreate() {
super.onCreate();
transcribeWhilePaused("onCreate");
transcript.add("finishedOnCreate");
}
代码示例来源:origin: avjinder/Minimal-Todo
@Override
public void onDestroy() {
super.onDestroy();
saveData();
}
代码示例来源:origin: chuyangliu/tastysnake
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
int val = super.onStartCommand(intent, flags, startId);
Log.d(TAG, "onStartCommand() called");
return val;
}
内容来源于网络,如有侵权,请联系作者删除!