Answer the question
In order to leave comments, you need to log in
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();
}
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();
}
});
Answer the question
In order to leave comments, you need to log in
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();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question