This file contains hidden or 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
| /** | |
| * @Retrieved from AOSP | |
| * Instrumentation class | |
| */ | |
| public void callActivityOnCreate(Activity activity, Bundle icicle) { | |
| //Note that the activity has already been initialized thanks to the prepareLaunchActivity(). | |
| //all that remains is just calling onCreate() | |
| prePerformCreate(activity); //prepares the activity | |
| activity.performCreate(icicle); //calls the oncreate | |
| postPerformCreate(activity); |
This file contains hidden or 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
| /** | |
| * Retrieved from AOSP | |
| * ActivityThread class | |
| */ | |
| //Handler created within the ActivityThreadClass, that holds a variety of id's for app events/states | |
| private class H extends Handler { | |
| public static final int LAUNCH_ACTIVITY = 100; | |
| public static final int PAUSE_ACTIVITY = 101; | |
| public static final int PAUSE_ACTIVITY_FINISHING= 102; |
This file contains hidden or 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
| /** | |
| * Retrieved from AOSP. | |
| * ActivityThread class | |
| */ | |
| private void handleLaunchActivity(ActivityClientRecord r, Intent customIntent, String reason) { | |
| //... initialize graphics,do some logging, call GC if need be, etc | |
| Activity a = performLaunchActivity(r, customIntent); | |
| //... handle how to resume an existing activity | |
| } | |
This file contains hidden or 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
| /** | |
| * Retrieved from AOSP | |
| * H class embedded in the ActivityThread class | |
| */ | |
| private class H extends Handler { | |
| //Several Application State Identifiers ... | |
| public void handleMessage(Message msg) { | |
| //other code | |
| switch (msg.what) { |
This file contains hidden or 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
| public class Parent { | |
| public static void main(Object []args) { | |
| System.out.println("Im in the main method!"); | |
| } | |
| } |
This file contains hidden or 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
| public class Parent { | |
| public static void main(String []args) { | |
| System.out.println("Im in the parent main method!"); | |
| } | |
| } | |
| //This is the class that is run | |
| public class Child { | |
| public static void main(String []args) { | |
| Parent.main(args); |
This file contains hidden or 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
| Sub Main() | |
| Debug.Print "Hello World!" | |
| MsgBox "Arguments if any are: " & Command$ | |
| End Sub |
This file contains hidden or 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
| import sys | |
| def main(argv): | |
| n = int(argv[1]) | |
| print(n + 1) | |
| if __name__ == '__main__': | |
| sys.exit(main(sys.argv)) |
This file contains hidden or 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
| int main() { | |
| write("Hello world!\n"); | |
| return 0; | |
| } |
This file contains hidden or 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
| main :: IO() | |
| main = | |
| putStrLn "Hello, World!" |