understanding of context

Understanding of context: The difference between an Android program and a Java program is that an Android program does not have a main() function to run like a Java program. It needs an Android engineering environment, and this environment is the context; among the four components, only Activity and Service are subclasses of context, so it depends on the number of contexts an Android program has (number of activities + number of services + 1 application); the inheritance relationship of contexts is not complicated, but the use of each is not possible in some cases For casual use, such as starting Activity and talking, you must use the context of the instance object of the Activity to call, otherwise an exception will be reported.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326059298&siteId=291194637