Skip to content

Instantly share code, notes, and snippets.

@Athosone
Created September 15, 2016 09:40
Show Gist options
  • Save Athosone/cb61cee00f499857e885fd69aef1e848 to your computer and use it in GitHub Desktop.
Save Athosone/cb61cee00f499857e885fd69aef1e848 to your computer and use it in GitHub Desktop.
: public enum BundleData
{
ItemPosition,
UserName
}
public static class Extensions
{
public static int GetBundleData(this Intent intent, BundleData data, int defaultValue)
=> intent.Extras.GetInt(data.ToString(), defaultValue);
public static void SetBundleData(this Intent intent, BundleData data, int value)
=> intent.PutExtra(data.ToString(), value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment