1 package host.exp.exponent.utils 2 3 /** 4 * This class is giving appropriate activity IDs based on the type of the activity. 5 * We have three types of Expo activities: 6 * 1. Kernel activity - this is always with activity ID = -1. 7 * 2. App activities - their IDs grow up starting from 0 as the kernel activity is initialized first. 8 * 3. Headless activities - IDs are decreasing starting from -2. 9 * */ 10 object ExpoActivityIds { 11 private var currentAppActivityId = 0 12 private var currentHeadlessActivityId = -2 13 getNextAppActivityIdnull14 fun getNextAppActivityId(): Int = currentAppActivityId++ 15 fun getNextHeadlessActivityId(): Int = currentHeadlessActivityId-- 16 } 17