Android - Context

> Android

1 - About

android/content/Context: Interface to global information about an application environment.

An activity is a subclass of context and is therefore a context.

Advertising

3 - Example

  • displaying different kind of data
  • of switching from viewing to entering data

4 - Configuration

4.1 - Layout file

In a layout file, see the tools:context attribute.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".MainActivity">
 
....
 
</RelativeLayout>