added JavaDoc comments

This commit is contained in:
prajgov 2017-12-19 20:54:28 +05:30
parent 4bb3e58c4e
commit 7e6374f11a
3 changed files with 77 additions and 5 deletions

View file

@ -18,6 +18,21 @@ public class WelcomeActivity extends BaseActivity {
private WelcomePagerAdapter adapter = new WelcomePagerAdapter();
/**
* Creates a way to change current activity to WelcomeActivity
*
* @param context Activity context
*/
public static void startYourself(Context context) {
Intent welcomeIntent = new Intent(context, WelcomeActivity.class);
context.startActivity(welcomeIntent);
}
/**
* Initialises exiting fields and dependencies
*
* @param savedInstanceState WelcomeActivity bundled data
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -30,14 +45,12 @@ public class WelcomeActivity extends BaseActivity {
adapter.setCallback(this::finish);
}
/**
* References WelcomePageAdapter to null before the activity is destroyed
*/
@Override
public void onDestroy() {
adapter.setCallback(null);
super.onDestroy();
}
public static void startYourself(Context context) {
Intent welcomeIntent = new Intent(context, WelcomeActivity.class);
context.startActivity(welcomeIntent);
}
}