Как добавить тег во вновь созданный экземпляр?
case 0:
return FragmentNotifications.newInstance(notifications, mCurrentTime);
Новый экземпляр:
public static FragmentNotifications
newInstance(String notificationsArray, long currentTime){
FragmentNotifications fragment = new FragmentNotifications();
return fragment;
}
Как назначить имя фрагменту, созданному с помощью viewpager?
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return
FragmentNotifications.newInstance(notifications, mCurrentTime);
case 1:
return FragmentMessages.newInstance(messages,
mCurrentTime);
case 2:
return new FragmentProfile();
default:
return null;
}
}