Android Intents - use of Context argument -
for intent constructor -
intent(context context, class myclass)
what context argument specify ?
also, ever need set context of other application ?
according context
documentation:
interface global information application environment. abstract class implementation provided android system. allows access application-specific resources , classes, up-calls application-level operations such launching activities, broadcasting , receiving intents, etc.
or in other words class provides access application.
also, ever need set context of other application ?
no, context of applciation provided android.
normally, 'normal' applications not need bother context. unless need activate application application or send message between 2 running applications.
if want launch application not need context though, not have context of application. instead, can ask android it (using application name), in form on intent
:
intent launchintent = getpackagemanager().getlaunchintentforpackage("com.package.address"); startactivity(launchintent);
see launch application application on android more information.
Comments
Post a Comment