List of usage examples for android.content Intent getBooleanExtra
public boolean getBooleanExtra(String name, boolean defaultValue)
From source file:com.commonsware.android.deepbg.PollReceiver.java
@Override public void onReceive(Context ctxt, Intent i) { Log.d(getClass().getSimpleName(), "Received alarm broadcast"); boolean isDownload = i.getBooleanExtra(EXTRA_IS_DOWNLOAD, false); startWakefulService(ctxt,//from ww w . ja va 2s .co m new Intent(ctxt, DemoScheduledService.class).putExtra(EXTRA_IS_DOWNLOAD, isDownload)); long period = i.getLongExtra(EXTRA_PERIOD, -1); if (period > 0) { scheduleExactAlarm(ctxt, (AlarmManager) ctxt.getSystemService(Context.ALARM_SERVICE), period, isDownload); } }
From source file:com.jefftharris.passwdsafe.AbstractFileListActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_file_list); Intent intent = getIntent(); itsIsCloseOnOpen = intent.getBooleanExtra(INTENT_EXTRA_CLOSE_ON_OPEN, false); FragmentManager fragMgr = getSupportFragmentManager(); FragmentTransaction txn = fragMgr.beginTransaction(); txn.replace(R.id.sync, new SyncProviderFragment()); txn.commit();/*from w w w . jav a2 s .c om*/ if (savedInstanceState == null) { setFileChooseFrag(); } }
From source file:ca.hoogit.garagepi.Utils.BaseReceiver.java
@Override public void onReceive(Context context, Intent intent) { String action = intent.getStringExtra(Consts.KEY_BROADCAST_ACTION); boolean wasSuccess = intent.getBooleanExtra(Consts.KEY_BROADCAST_SUCCESS, false); String message = intent.getStringExtra(Consts.KEY_BROADCAST_MESSAGE); Log.d(TAG, "onReceive: Message received: Action:" + action + " Success: " + wasSuccess + " Message: " + message);// w w w.java2s. co m if (mListener != null) { mListener.onMessage(action, wasSuccess, message); } messageReceived(action, wasSuccess, message); }
From source file:com.commonsware.android.broadcast.fanout.EventLogFragment.java
private String getEventLabel(Intent event) { if (event.getAction() == null) { return ("explicit"); } else if (event.getBooleanExtra(TestReceiver.EXTRA_IS_FANOUT, false)) { return ("fanout"); }// w w w .j av a 2 s . c o m return ("implicit"); }
From source file:com.ferdi2005.secondgram.VideoEncodingService.java
public int onStartCommand(Intent intent, int flags, int startId) { path = intent.getStringExtra("path"); boolean isGif = intent.getBooleanExtra("gif", false); if (path == null) { stopSelf();/*from ww w . ja v a 2 s .co m*/ return Service.START_NOT_STICKY; } FileLog.e("start video service"); if (builder == null) { builder = new NotificationCompat.Builder(ApplicationLoader.applicationContext); builder.setSmallIcon(android.R.drawable.stat_sys_upload); builder.setWhen(System.currentTimeMillis()); builder.setContentTitle(LocaleController.getString("AppName", R.string.AppName)); if (isGif) { builder.setTicker(LocaleController.getString("SendingGif", R.string.SendingGif)); builder.setContentText(LocaleController.getString("SendingGif", R.string.SendingGif)); } else { builder.setTicker(LocaleController.getString("SendingVideo", R.string.SendingVideo)); builder.setContentText(LocaleController.getString("SendingVideo", R.string.SendingVideo)); } } currentProgress = 0; builder.setProgress(100, currentProgress, currentProgress == 0); startForeground(4, builder.build()); NotificationManagerCompat.from(ApplicationLoader.applicationContext).notify(4, builder.build()); return Service.START_NOT_STICKY; }
From source file:com.sparkplatform.ui.WebViewActivity.java
@SuppressLint("SetJavaScriptEnabled") @Override/*from www. j a v a 2 s. c o m*/ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web_view); this.sparkClient = SparkAPI.getInstance(); Intent intent = getIntent(); loginHybrid = intent.getBooleanExtra(UIConstants.EXTRA_LOGIN_HYBRID, true); WebView webView = (WebView) findViewById(R.id.webview); WebSettings webSettings = webView.getSettings(); webSettings.setJavaScriptEnabled(true); webView.setWebViewClient(new SparkWebViewClient()); webView.loadUrl(SparkAPI.sparkOpenIdLogoutURL); }
From source file:de.vanita5.twittnuker.activity.support.AccountSelectorActivity.java
private boolean isOAuthOnly() { final Intent intent = getIntent(); return intent.getBooleanExtra(EXTRA_OAUTH_ONLY, false); }
From source file:de.vanita5.twittnuker.activity.support.AccountSelectorActivity.java
private boolean isSelectNoneAllowed() { final Intent intent = getIntent(); return intent.getBooleanExtra(EXTRA_ALLOW_SELECT_NONE, false); }
From source file:de.vanita5.twittnuker.activity.support.AccountSelectorActivity.java
private boolean isSingleSelection() { final Intent intent = getIntent(); return intent.getBooleanExtra(EXTRA_SINGLE_SELECTION, false); }
From source file:com.commonsware.android.service.lifecycle.DemoService.java
@Override public int onStartCommand(Intent intent, int flags, int startId) { Log.d("DemoService", "onStartCommand()"); boolean foreground = intent.getBooleanExtra(EXTRA_FOREGROUND, false); boolean importantish = intent.getBooleanExtra(EXTRA_IMPORTANTISH, false); if (foreground) { String channel = importantish ? CHANNEL_LOW : CHANNEL_MIN; startForeground(1337, buildForegroundNotification(channel)); }//from ww w . ja v a 2 s . c o m return (super.onStartCommand(intent, flags, startId)); }