What's the difference for creating an Intent with context between getApplicationContext() or activity
Clash Royale CLAN TAG#URR8PPP
What's the difference for creating an Intent with context between getApplicationContext() or activity
We always create an Intent with context
Intent intent = Intent(context, SomeClass.class)
I can use this(activity) or getActivity(fragment) as context, in some situations I can use getApplicationContext.
My question is what't the difference for Intent under there two circumstances?
1 Answer
1
getApplicationContext() is giving application context but context is giving current activity context.I hope its help you.
But for that Intent?
– BollMose
Aug 7 at 2:18
you can use onActivityResult() for R&D
– kundan kamal
Aug 7 at 6:18
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
stackoverflow.com/a/14658478/527808
– dilix
Aug 6 at 14:08