Saturday, July 21, 2012

How to get application context

To get the context, the method Context.getApplicationContext() or Activity.getApplication() can be used.

        
        textContext1.setText("using getApplicationContext():\n" + getApplicationContext());
        textContext2.setText("using getApplication():\n" + getApplication());

No comments:

Post a Comment