Advertisement
roko_man

e

Nov 18th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @AutoValue
  2. public abstract class MediaKey  extends BaseKey
  3. {
  4.     private MediaFragment mediaFragment;
  5.  
  6.     public static MediaKey create()
  7.     {
  8.         return new AutoValue_MediaKey();
  9.     }
  10.  
  11.     @Override
  12.     public BaseFragment createFragment()
  13.     {
  14.         if(mediaFragment == null)
  15.         {
  16.             mediaFragment = new MediaFragment();
  17.         }
  18.  
  19.         return mediaFragment;
  20.     }
  21. }
  22.  
  23.  
  24. MediaKey key = MediaKey.create();
  25.  
  26. Bundle bundle = new Bundle();
  27. bundle.putInt(GeneralUtils.CLEAR_APP_MAIN_POS,position);
  28. bundle.putInt(GeneralUtils.CLEAR_APP_SUB_POS,0);
  29. MainModel mainModel = appModel.getSubCategories().get(0);
  30.  
  31. bundle.putParcelable(GeneralUtils.MEDIA_BOOSTER_SUBS_KEY,mainModel);
  32. /* TODO send sub key */
  33. key.createFragment().setArguments(bundle);
  34. MainActivity.get(rootView.getContext()).navigateTo(key);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement