I recently started using Android Studio to work on my Android projects. I notice that at the bottom right corner of the IDE, there is the text Context: <no context>
. Curiosity has gotten the best of me, so now I am searching online for more information. I have not found anything that resembles this functionality, so now I have come for you all.
What is this text for? What is it trying to display? How is it changed? How does it interact with my project?
Thanks for the help!
Definition. it's the context of current state of the application/object. It lets newly-created objects understand what has been going on. Typically, you call it to get information regarding another part of your program (activity and package/application).
Application Context: It is the application and we are present in Application. For example - MyApplication(which extends Application class). It is an instance of MyApplication only. Activity Context: It is the activity and we are present in Activity.
They are both instances of Context, but the application instance is tied to the lifecycle of the application, while the Activity instance is tied to the lifecycle of an Activity. Thus, they have access to different information about the application environment.
Context is an abstract class whose implementation is given by Android system. It helps in using the application resources, launching activities, broadcast and many more. It tells the compiler to which context activity or application your current belongs which you want to show.
Contexts are like a visual bookmark of a set of files open and commonly used together.
You can load/save contexts from the Tools menu. They come in handy when use in conjunction with Tasks that are linked to an Issue Tracker so all files you are editing for a particular issue are automatically opened when you switch to that task.
For full details of how to use them see the IntellJ Documentation
As far as I understand that, this has nothing to do with Contexts from the Tools-menu, but with NDK-Contexts.
First, creating a new context from the Tools-menu does not change "Context: " in the statusbar, second googling "Context " brought me to this bugtracker-entry:
https://code.google.com/p/android/issues/detail?id=187899
ie. previously there was a drop-down-menu in the statusbar, even when NDK was not installed. Now it says "not available", because NDK is not installed (?) (But I didn't check, if that changes, when NDK is installed...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With