java icache_Java ICacheWordSubscriber類代碼示例
import info.guardianproject.cacheword.ICacheWordSubscriber; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mApp = (ImApp)getApplication();
mHandler = new MyHandler(this);
Intent intent = getIntent();
mDoLock = ACTION_LOCK_APP.equals(intent.getAction());
if (mDoLock) {
shutdownAndLock(this);
return;
} else if (Panic.isTriggerIntent(intent)) {
if (PanicResponder.receivedTriggerFromConnectedApp(this)) {
if (Preferences.uninstallApp()) {
// lock and delete first for rapid response, then uninstall
shutdownAndLock(this);
PanicResponder.deleteAllAppData(this);
Intent uninstall = new Intent(Intent.ACTION_DELETE);
uninstall.setData(Uri.parse("package:" + getPackageName()));
startActivity(uninstall);
} else if (Preferences.clearAppData()) {
// lock first for rapid response, then delete
shutdownAndLock(this);
PanicResponder.deleteAllAppData(this);
} else if (Preferences.lockApp()) {
shutdownAndLock(this);
}
// TODO add other responses here, paying attention to if/else order
} else if (PanicResponder.shouldUseDefaultResponseToTrigger(this)) {
if (Preferences.lockApp()) {
shutdownAndLock(this);
}
}
// this Intent should not trigger any more processing
finish();
return;
}
mSignInHelper = new SignInHelper(this, mHandler);
mDoSignIn = intent.getBooleanExtra(EXTRA_DO_SIGNIN, true);
AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
mCacheWord = new CacheWordHandler(this, (ICacheWordSubscriber)this);
mCacheWord.connectToService();
// if we have an incoming contact, send it to the right place
String scheme = intent.getScheme();
if(TextUtils.equals(scheme, "xmpp"))
{
intent.setClass(this, AddContactActivity.class);
startActivity(intent);
finish();
return;
}
}
總結
以上是生活随笔為你收集整理的java icache_Java ICacheWordSubscriber類代碼示例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java分割面板_Split 面板分割
- 下一篇: java加快内存回收_java内存管理之