Esempio n. 1
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();
    }
  }
 public static void removeActionBarLoading(MenuItem refreshButton) {
   if (refreshButton != null) {
     refreshButton.collapseActionView();
     refreshButton.setActionView(null);
   }
 }