コード例 #1
0
  @Override
  public void onNewTweet(Tweet tweet) {

    //		HomeTimeLineFragment fragment = (HomeTimeLineFragment) adapterViewPager
    //				.getItem(POSITION_OF_HOMETIMELINE);
    //
    supportFragmentManager = getSupportFragmentManager();
    HomeTimeLineFragment fragment =
        (HomeTimeLineFragment)
            supportFragmentManager.findFragmentByTag(
                makeFragmentName(R.id.viewPager, POSITION_OF_HOMETIMELINE));
    if (fragment != null) {
      fragment.addNewTweet(tweet);
    }
  }
コード例 #2
0
 @Override
 public Fragment getItem(int position) {
   switch (position) {
     case POSITION_OF_HOMETIMELINE:
       return HomeTimeLineFragment.newInstance(position, "Home");
     case POSITION_OF_MENTIONS:
       return MentionsFragment.newInstance(position, "Mentions");
     case POSITION_OF_DIRECTMSGS:
       return DirectMessagesFragments.newInstance(position, "Mentions");
     default:
       return null;
   }
 }