コード例 #1
0
ファイル: BaseActivity.java プロジェクト: AdAway/AdAway
  /**
   * 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);
      }
    }
  }
コード例 #2
0
ファイル: ChannelActivity.java プロジェクト: lugkhast/Plumble
  @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();
    }
  }
コード例 #3
0
 @Override
 protected void onNewIntent(Intent intent) {
   super.onNewIntent(intent);
   setIntent(intent);
   handleIntent(intent);
 }
コード例 #4
0
 @Override
 protected void onNewIntent(Intent intent) {
   super.onNewIntent(intent);
   resetInternals();
 }
コード例 #5
0
 @Override
 protected void onNewIntent(Intent intent) {
   super.onNewIntent(intent);
   Log.w("SecureSMS", "Got onNewIntent...");
   createConversationIfNecessary(intent);
 }