I recently started using java and I'm trying to understand what exactly "Context" is, and how to use it properly.
public AdapterView.OnItemClickListener selectDevice = new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
String info = ((TextView) view).getText().toString();
String adress = info.substring(info.length()-17);
Intent comIntent = new Intent(MainActivity.this, Communication.class); //WHY???
}
};
For this example and Intent arguement , why don't we use "getContext()" or "getApplicationContext" or just "this"?