Example #1
0
  /**
   * Handle result from applying when clicked on notification
   * http://stackoverflow.com/questions/1198558
   * /how-to-send-parameters-from-a-notification-click-to-an-activity BaseActivity launchMode is set
   * to SingleTop for this in AndroidManifest
   */
  @Override
  protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    Log.d(Constants.TAG, "onNewIntent");

    // if a notification is clicked after applying was done, the following is processed
    Bundle extras = intent.getExtras();
    if (extras != null) {
      if (extras.containsKey(EXTRA_APPLYING_RESULT)) {
        int result = extras.getInt(EXTRA_APPLYING_RESULT);
        Log.d(Constants.TAG, "Result from intent extras: " + result);

        // download failed because of url
        String numberOfSuccessfulDownloads = null;
        if (extras.containsKey(EXTRA_NUMBER_OF_SUCCESSFUL_DOWNLOADS)) {
          numberOfSuccessfulDownloads = extras.getString(EXTRA_NUMBER_OF_SUCCESSFUL_DOWNLOADS);
          Log.d(
              Constants.TAG,
              "Applying information from intent extras: " + numberOfSuccessfulDownloads);
        }

        ResultHelper.showDialogBasedOnResult(mActivity, result, numberOfSuccessfulDownloads);
      }
    }
  }
Example #2
0
  @Override
  protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);

    // Join channel selected in search suggestions if present
    if (intent != null
        && intent.getAction() != null
        && intent.getAction().equals(Intent.ACTION_SEARCH)) {
      String resultType = (String) intent.getSerializableExtra(SearchManager.EXTRA_DATA_KEY);
      Uri data = intent.getData();

      if (resultType.equals(ChannelSearchProvider.INTENT_DATA_CHANNEL)) {
        int channelId = Integer.parseInt(data.getLastPathSegment());
        Channel channel = mService.getChannel(channelId);
        listFragment.scrollToChannel(channel);
      } else if (resultType.equals(ChannelSearchProvider.INTENT_DATA_USER)) {
        int session = Integer.parseInt(data.getLastPathSegment());
        User user = mService.getUser(session);
        listFragment.scrollToUser(user);
      }

      if (searchItem != null) searchItem.collapseActionView();
    }
  }
 @Override
 protected void onNewIntent(Intent intent) {
   super.onNewIntent(intent);
   setIntent(intent);
   handleIntent(intent);
 }
 @Override
 protected void onNewIntent(Intent intent) {
   super.onNewIntent(intent);
   resetInternals();
 }
 @Override
 protected void onNewIntent(Intent intent) {
   super.onNewIntent(intent);
   Log.w("SecureSMS", "Got onNewIntent...");
   createConversationIfNecessary(intent);
 }