Last active
October 3, 2018 01:58
-
-
Save alejandro-rios/261b4a35c70422398ed44bc998680853 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MainActivity.java | |
public class MainActivity extends AppCompactActivity{ | |
public static String extra_item_id = "some item id"; | |
public static boolean extra_wanna_show = true; | |
public static String getExtraItemId(){ | |
return extra_item_id; | |
} | |
public static boolean getExtraWannaShow(){ | |
return extra_wanna_show; | |
} | |
} | |
// SomeAwesomeAndHyperRealisticDetailActivity.java | |
public String EXTRA_ITEM_ID = MainActivity.getExtraItemId(); | |
public boolean EXTRA_WANNA_SHOW = MainActivity.getExtraWannaShow(); | |
.... | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
.... | |
if (EXTRA_ITEM_ID != null) { | |
Log.i("The App", "Yayyyyyy!!!"); | |
} else { | |
throw new IllegalStateException("Why god whyyyyy!!!!"); | |
} | |
.... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment