How can I store user data (shared preferences) in this code?
<p>My Mainpage is the facebook-login activity and will proceed to navigation drawer.Everything works fine but I need to LogIn every time I open the app. Ive tried to do sharedpreferences and accesstoken. I dont know how to do it with this code. Pls hlp me.</p>

<p>This is my Main.java</p>

<pre><code>public class Main extends AppCompatActivity {
CallbackManager callbackManager;
LoginButton loginButton; //facebookLoginButton


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    FacebookSdk.sdkInitialize(getApplicationContext());
    callbackManager = CallbackManager.Factory.create();

    setContentView(R.layout.activity_main);

    loginButton = (LoginButton) findViewById(R.id.login_button);
    assert loginButton != null;
    loginButton.setReadPermissions("email");

    loginButton.registerCallback(callbackManager, new FacebookCallback&lt;LoginResult&gt;() {
        @Override
        public void onSuccess(LoginResult login_result) {

            getUserInfo(login_result);
        }

        @Override
        public void onCancel() {

        }

        @Override
        public void onError(FacebookException exception) {

        }
    });
}

protected void getUserInfo(LoginResult login_result){

    GraphRequest data_request = GraphRequest.newMeRequest(
            login_result.getAccessToken(),
            new GraphRequest.GraphJSONObjectCallback() {
                @Override
                public void onCompleted(
                        JSONObject json_object,
                        GraphResponse response) {

                    Intent intent = new Intent(Main.this,HomeActivity.class);
                    intent.putExtra("jsondata",json_object.toString());
                    startActivity(intent);
                }
            });
    Bundle parameter = new Bundle();
    parameter.putString("fields", "id,name,email,picture.width(150).height(150)");
    data_request.setParameters(parameter);
    data_request.executeAsync();

}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    callbackManager.onActivityResult(requestCode, resultCode, data);
    Log.e("data", data.toString());
}

 @Override
protected void onResume() {
    super.onResume();

}

@Override
protected void onPause() {
    super.onPause();

}
}
</code></pre>

<p>Help pls.</p>