roko_man icon

e

roko_man | PRO | 11/18/18 02:07:30 PM UTC | 0 ⭐ | 243 👁️ | Never ⏰ | []
Java |

830 B

|

None

|

0 👍

/

0 👎

@AutoValue
public abstract class MediaKey  extends BaseKey
{
    private MediaFragment mediaFragment;
 
    public static MediaKey create()
    {
        return new AutoValue_MediaKey();
    }
 
    @Override
    public BaseFragment createFragment()
    {
        if(mediaFragment == null)
        {
            mediaFragment = new MediaFragment();
        }
 
        return mediaFragment;
    }
}
 
 
MediaKey key = MediaKey.create();
 
Bundle bundle = new Bundle();
bundle.putInt(GeneralUtils.CLEAR_APP_MAIN_POS,position);
bundle.putInt(GeneralUtils.CLEAR_APP_SUB_POS,0);
MainModel mainModel = appModel.getSubCategories().get(0);
 
bundle.putParcelable(GeneralUtils.MEDIA_BOOSTER_SUBS_KEY,mainModel);
/* TODO send sub key */
key.createFragment().setArguments(bundle);
MainActivity.get(rootView.getContext()).navigateTo(key);

Comments