List of usage examples for android.content Intent getBooleanExtra
public boolean getBooleanExtra(String name, boolean defaultValue)
From source file:com.callrecorder.android.RecordService.java
@Override public int onStartCommand(Intent intent, int flags, int startId) { Log.d(Constants.TAG, "RecordService onStartCommand"); if (intent != null) { int commandType = intent.getIntExtra("commandType", 0); if (commandType != 0) { if (commandType == Constants.RECORDING_ENABLED) { Log.d(Constants.TAG, "RecordService RECORDING_ENABLED"); silentMode = intent.getBooleanExtra("silentMode", true); if (!silentMode && phoneNumber != null && onCall && !recording) commandType = Constants.STATE_START_RECORDING; } else if (commandType == Constants.RECORDING_DISABLED) { Log.d(Constants.TAG, "RecordService RECORDING_DISABLED"); silentMode = intent.getBooleanExtra("silentMode", true); if (onCall && phoneNumber != null && recording) commandType = Constants.STATE_STOP_RECORDING; }/* w w w . j a v a 2s .co m*/ if (commandType == Constants.STATE_INCOMING_NUMBER) { Log.d(Constants.TAG, "RecordService STATE_INCOMING_NUMBER"); startService(); if (phoneNumber == null) phoneNumber = intent.getStringExtra("phoneNumber"); silentMode = intent.getBooleanExtra("silentMode", true); } else if (commandType == Constants.STATE_CALL_START) { Log.d(Constants.TAG, "RecordService STATE_CALL_START"); onCall = true; if (!silentMode && phoneNumber != null && onCall && !recording) { startService(); startRecording(intent); } } else if (commandType == Constants.STATE_CALL_END) { Log.d(Constants.TAG, "RecordService STATE_CALL_END"); onCall = false; phoneNumber = null; stopAndReleaseRecorder(); recording = false; stopService(); } else if (commandType == Constants.STATE_START_RECORDING) { Log.d(Constants.TAG, "RecordService STATE_START_RECORDING"); if (!silentMode && phoneNumber != null && onCall) { startService(); startRecording(intent); } } else if (commandType == Constants.STATE_STOP_RECORDING) { Log.d(Constants.TAG, "RecordService STATE_STOP_RECORDING"); stopAndReleaseRecorder(); recording = false; } } } return super.onStartCommand(intent, flags, startId); }
From source file:com.mobicage.rogerthat.AbstractHomeActivity.java
private void processIntent(final Intent intent) { final String url = intent.getDataString(); if (intent.getBooleanExtra(INTENT_PROCESSED, false)) return;//from w w w .j a va 2 s. c om if (url != null) { goToMessagingActivity(); processUrl(url); } else if (intent.hasExtra(INTENT_KEY_LAUNCHINFO)) { String value = intent.getStringExtra(INTENT_KEY_LAUNCHINFO); if (INTENT_VALUE_SHOW_FRIENDS.equals(value)) { // goToUserFriendsActivity(); } else if (INTENT_VALUE_SHOW_MESSAGES.equals(value)) { goToMessagingActivity(); } else if (INTENT_VALUE_SHOW_NEW_MESSAGES.equals(value)) { if (intent.hasExtra(INTENT_KEY_MESSAGE)) { String messageKey = intent.getStringExtra(INTENT_KEY_MESSAGE); goToMessageDetail(messageKey); } else { goToMessagingActivity(); } } else if (INTENT_VALUE_SHOW_UPDATED_MESSAGES.equals(value)) { if (intent.hasExtra(INTENT_KEY_MESSAGE)) { String messageKey = intent.getStringExtra(INTENT_KEY_MESSAGE); goToMessageDetail(messageKey); } else { goToMessagingActivity(); } } else if (INTENT_VALUE_SHOW_SCANTAB.equals(value)) { goToScanActivity(); } else { L.bug("Unexpected (key, value) for HomeActivity intent: (" + INTENT_KEY_LAUNCHINFO + ", " + value + ")"); } if (mMessagingPlugin != null) { mMessagingPlugin.updateMessagesNotification(false, false, false); handleBadgeMessages(); } } intent.putExtra(INTENT_PROCESSED, true); }
From source file:dk.ciid.android.infobooth.activities.IntroductionActivity.java
@Override public void onCreate(Bundle savedInstanceState) { /* Variables received through Intent */ Intent openActivity = getIntent(); // this is just for example purpose isInDebugMode = openActivity.getBooleanExtra("isInDebugMode", true); // should the app send a welcome sms after subscribing? voice1 = openActivity.getStringExtra("voice1"); // path to voice file 1 voice2 = openActivity.getStringExtra("voice2"); // path to voice file 2 voice3 = openActivity.getStringExtra("voice3"); // path to voice file 3 voice4 = openActivity.getStringExtra("voice4"); // path to voice file 4 voice5 = openActivity.getStringExtra("voice5"); // path to voice file 5 voice6 = openActivity.getStringExtra("voice6"); // path to voice file 6 /* Variables received through Intent */ super.onCreate(savedInstanceState); /* ARDUINO COMMUNICATION STUFF ********************************************/ // a reference to the USB system service is obtained so that you can call its methods later on mUsbManager = UsbManager.getInstance(this); mPermissionIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0); IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION); filter.addAction(UsbManager.ACTION_USB_ACCESSORY_DETACHED); registerReceiver(mUsbReceiver, filter); if (getLastNonConfigurationInstance() != null) { mAccessory = (UsbAccessory) getLastNonConfigurationInstance(); openAccessory(mAccessory);/*from w ww. j a v a 2s .co m*/ } /* ARDUINO COMMUNICATION STUFF ********************************************/ gestureScanner = new GestureDetector(this); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_introduction); // Set up sound playback initMediaPlayer(); runOnUiThread(new Runnable() { public void run() { if (isInDebugMode) Toast.makeText(getApplicationContext(), "Debug mode is ON", Toast.LENGTH_SHORT).show(); } }); }
From source file:com.geryon.ocraa.MusicService.java
public void processRepeat(Intent intent) { repeat = intent.getBooleanExtra("repeat", true); Log.d("ServiceRepeat", String.valueOf(repeat)); }
From source file:com.google.android.libraries.cast.companionlibrary.notification.VideoCastNotificationService.java
@Override public int onStartCommand(Intent intent, int flags, int startId) { LOGD(TAG, "onStartCommand"); if (intent != null) { String action = intent.getAction(); if (ACTION_VISIBILITY.equals(action)) { mVisible = intent.getBooleanExtra(NOTIFICATION_VISIBILITY, false); LOGD(TAG, "onStartCommand(): Action: ACTION_VISIBILITY " + mVisible); onRemoteMediaPlayerStatusUpdated(mCastManager.getPlaybackStatus()); if (mNotification == null) { try { setUpNotification(mCastManager.getRemoteMediaInformation()); } catch (TransientNetworkDisconnectionException | NoConnectionException e) { LOGE(TAG, "onStartCommand() failed to get media", e); }//from w w w . j a v a 2s . co m } if (mVisible && mNotification != null) { startForeground(NOTIFICATION_ID, mNotification); } else { stopForeground(true); } } } return Service.START_STICKY; }
From source file:com.geryon.ocraa.MusicService.java
public void processShuffle(Intent intent) { shuffle = intent.getBooleanExtra("shuffle", true); Log.d("ServiceShuffle", String.valueOf(shuffle)); }
From source file:com.mobicage.rogerthat.GroupDetailActivity.java
@Override protected void onServiceBound() { T.UI();//from ww w. ja v a 2s. c o m registerReceiver(mBroadcastReceiver, new IntentFilter(FriendsPlugin.GROUPS_UPDATED)); mLinearLayout = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.group_detail, null); setContentView(mLinearLayout); mFriendsPlugin = mService.getPlugin(FriendsPlugin.class); Intent intent = getIntent(); String guid = intent.getStringExtra(GUID); mIsNewGroup = intent.getBooleanExtra(NEW_GROUP, false); if (mIsNewGroup) { updateGroupLayout(true); } mGroup = mFriendsPlugin.getStore().getGroup(guid); mBackupMembers = new ArrayList<String>(mGroup.members); mUpdateGroupName = ((EditText) findViewById(R.id.update_group_name_value)); updateView(); }
From source file:com.mindprotectionkit.freephone.RedPhoneService.java
private void handleSetMute(Intent intent) { if (currentCallManager != null) { currentCallManager.setMute(intent.getBooleanExtra(Constants.MUTE_VALUE, false)); }/*from w w w . j a v a 2 s . c o m*/ }
From source file:com.radicaldynamic.groupinform.activities.AccountFolderList.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.generic_list); if (savedInstanceState == null) { Intent intent = getIntent(); if (intent == null) { // Load defaults } else {//from w ww .ja va 2s . co m mCopyToFolder = intent.getBooleanExtra(KEY_COPY_TO_FOLDER, false); } } else { if (savedInstanceState.containsKey(KEY_COPY_TO_FOLDER)) mCopyToFolder = savedInstanceState.getBoolean(KEY_COPY_TO_FOLDER); if (savedInstanceState.containsKey(KEY_FOLDER_ID)) mSelectedFolderId = savedInstanceState.getString(KEY_FOLDER_ID); if (savedInstanceState.containsKey(KEY_FOLDER_NAME)) mSelectedFolderName = savedInstanceState.getString(KEY_FOLDER_NAME); Object data = getLastNonConfigurationInstance(); if (data instanceof RefreshViewTask) mRefreshViewTask = (RefreshViewTask) data; else if (data instanceof SynchronizeFoldersTask) mSynchronizeFoldersTask = (SynchronizeFoldersTask) data; } if (mCopyToFolder) setTitle(getString(R.string.app_name) + " > " + getString(R.string.tf_copy_to_folder)); else setTitle(getString(R.string.app_name) + " > " + getString(R.string.tf_form_folders)); }
From source file:com.prashantmaurice.shadowfaxhackandroid.RecordService.java
@Override public int onStartCommand(Intent intent, int flags, int startId) { Log.d(Constants.TAG, "RecordService onStartCommand"); if (intent != null) { int commandType = intent.getIntExtra("commandType", 0); if (commandType != 0) { if (commandType == Constants.RECORDING_ENABLED) { Log.d(Constants.TAG, "RecordService RECORDING_ENABLED"); silentMode = intent.getBooleanExtra("silentMode", true); if (!silentMode && phoneNumber != null && onCall && !recording) commandType = Constants.STATE_START_RECORDING; } else if (commandType == Constants.RECORDING_DISABLED) { Log.d(Constants.TAG, "RecordService RECORDING_DISABLED"); silentMode = intent.getBooleanExtra("silentMode", true); if (onCall && phoneNumber != null && recording) commandType = Constants.STATE_STOP_RECORDING; }// w ww .j a va2s. com if (commandType == Constants.STATE_INCOMING_NUMBER) { Log.d(Constants.TAG, "RecordService STATE_INCOMING_NUMBER"); startService(); if (phoneNumber == null) phoneNumber = intent.getStringExtra("phoneNumber"); silentMode = intent.getBooleanExtra("silentMode", false); } else if (commandType == Constants.STATE_CALL_START) { Log.d(Constants.TAG, "RecordService STATE_CALL_START"); onCall = true; if (!silentMode && phoneNumber != null && onCall && !recording) { startService(); startRecording(intent); } } else if (commandType == Constants.STATE_CALL_END) { Log.d(Constants.TAG, "RecordService STATE_CALL_END"); onCall = false; phoneNumber = null; stopAndReleaseRecorder(); recording = false; stopService(); } else if (commandType == Constants.STATE_START_RECORDING) { Log.d(Constants.TAG, "RecordService STATE_START_RECORDING"); if (!silentMode && phoneNumber != null && onCall) { startService(); startRecording(intent); } } else if (commandType == Constants.STATE_STOP_RECORDING) { Log.d(Constants.TAG, "RecordService STATE_STOP_RECORDING"); stopAndReleaseRecorder(); recording = false; } } } return super.onStartCommand(intent, flags, startId); }