This and Getapplicationcontext differences
public class MyActivity extends Activity {
public void Method () {
Mcontext = this; Since Activity extends Context
Mcontext = Getapplicationcontext ();
Mcontext = Getbasecontext ();
}
}
This is because activity expands the context, whose life cycle is activity creation to destruction;
The context that Getapplicationcontext obtains is that the life cycle associated with application is applied to the creation of the pin.
Getbasecontext () Returns the context that is set by the constructor or Setbasecontext () to make sure that the life cycle is not making mistakes during use.
For example, there is a global data manipulation class, using the context, this time to use the getapplicationcontext, not with activity, this ensures that the operation of the database is not related to activity.
Source: http://blog.csdn.net/ultrapro/article/details/6617359
[Turn]this and Getapplicationcontext differences