N
N
Nick20152016-01-20 21:23:55
Android
Nick2015, 2016-01-20 21:23:55

SignActivity and back stack.....?

The bottom line is this:
There is a SignActivity in it, authorization occurs using social networks, after authorization of the user, after 5 seconds, it transfers to the next activity in which the work takes place. Also, with this activity, which buckets, after registration, I can switch to acts with authorization. The question is how to make that activity NOT added to the back stack.
It works ..... nooo nooo: then when a user logs in 1 time and passes authorization, it does not work and the program (activity) just closes. How can I track the feedback of this com.facebook.FacebookActivity and after pressing the "OK" button (there is also a cancellation when the user agrees) reopen .... Or what's the problem here is the code itself .....
android:noHistory="true"

private void getUserDetailsFromFB() {
        Bundle parameters = new Bundle();
        parameters.putString("fields", "id,email,name,picture");
        if(mFbProfile !=null)
            Log.i("ID",""+        mFbProfile.getId());

        new GraphRequest(
                AccessToken.getCurrentAccessToken(),
                "/me",
                parameters,
                HttpMethod.GET,
                new GraphRequest.Callback() {
                    public void onCompleted(GraphResponse response) {
            /* handle the result */
                        try {

                            Log.d("Response", response.getRawResponse());
                            email = response.getJSONObject().getString("email");
                            mEmailID.setText(email);

                            name = response.getJSONObject().getString("name");
                            mUsername.setText(name);

                              saveNewUser();

                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                    }
                }
        ).executeAsync();
    }

And user data is written to parse.com
private void saveNewUser() {
        parseUser = ParseUser.getCurrentUser();
        parseUser.setUsername(name);
        parseUser.setEmail(email);
//        Finally save all the user details
                    parseUser.saveInBackground(new SaveCallback() {
                        @Override
                        public void done(ParseException e) {
                            Toast.makeText(SignActivity.this, "New user:" + name + " Signed up", Toast.LENGTH_SHORT).show();
                        }
                    });

Tell me please!!!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Goryachkin, 2016-01-20
@Nick2015

In general, you can use the FLAG_ACTIVITY_CLEAR_TOP flag when starting a new activity :

Intent intent = new Intent(getBaseContext(), NewActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();

The FLAG_ACTIVITY_CLEAR_TOP flag will just allow you to clear the stack when opening a new activity.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question