package fr.free.nrw.commons;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.ViewPager;

import com.viewpagerindicator.CirclePageIndicator;

import butterknife.BindView;
import butterknife.ButterKnife;
import fr.free.nrw.commons.theme.BaseActivity;

public class WelcomeActivity extends BaseActivity {

    @BindView(R.id.welcomePager) ViewPager pager;
    @BindView(R.id.welcomePagerIndicator) CirclePageIndicator indicator;

    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);
        setContentView(R.layout.activity_welcome);

        ButterKnife.bind(this);

        pager.setAdapter(adapter);
        indicator.setViewPager(pager);
        adapter.setCallback(this::finish);
    }

    /**
     * References WelcomePageAdapter to null before the activity is destroyed
     */
    @Override
    public void onDestroy() {
        adapter.setCallback(null);
        super.onDestroy();
    }
}

@@ -567,321 +567,8 @@
 );%0A%0A
-    /**%0A     * Creates a way to change current activity to WelcomeActivity%0A     *%0A     * @param context Activity context%0A     */%0A    public static void startYourself(Context context) %7B%0A        Intent welcomeIntent = new Intent(context, WelcomeActivity.class);%0A        context.startActivity(welcomeIntent);%0A    %7D%0A%0A
     
@@ -1226,10 +1226,327 @@
 ;%0A    %7D%0A
+    %0A    /**%0A     * Creates a way to change current activity to WelcomeActivity%0A     *%0A     * @param context Activity context%0A     */%0A    public static void startYourself(Context context) %7B%0A        Intent welcomeIntent = new Intent(context, WelcomeActivity.class);%0A        context.startActivity(welcomeIntent);%0A    %7D%0A
 %7D%0A

Update WelcomeActivity.java