Why Activity lifecycles method overrides and why it calling super.method()?
-There is already set of default functionalities of Activity. We are replacing existing functionalities of the same.
(ex)
@Override
protected void onCreate(Bundle savedInstanceState)
{
}
But we must use the default functionality of an activity so that is the reason why we are calling the base method.
(ex)
super.onCreate();
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
-There is already set of default functionalities of Activity. We are replacing existing functionalities of the same.
(ex)
@Override
protected void onCreate(Bundle savedInstanceState)
{
}
(ex)
super.onCreate();
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
Share this on your favourite network
0 comments :
Post a Comment