Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I start a new activity when I click the finish button or reach the last slide #28

Closed
Spiderbezno opened this issue Mar 22, 2016 · 7 comments

Comments

@Spiderbezno
Copy link

How Can I Star new activity when I click finish button or last slide

@Maxr1998
Copy link
Contributor

Override finish() in your Activity and call startActivity() from there.

Something like:

@Override
public void finish() {
    startActivity(this, YourActivity.class);
    super.finish();
}

@Spiderbezno
Copy link
Author

Thx, I true, I hadn't thought in this option
Override finish() and call startActivity() from there.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#28 (comment)

@janheinrichmerker
Copy link
Owner

Hey @Spiderbenzo, look at the example. There's sample code on how to open a new activity while having the fancy fade effect on the last page. Take a look at FinishActivity for more information.
Also feel free to ask here if you run into problems.

@daniel-stoneuk
Copy link
Collaborator

Unfortunately, pressing back during the IntroActivity will take you to the activity which you want to display after the intro. I've added some code to onBackPressed which takes you to the home screen instead of the previous activity (or in this case, the next activity). I know this isn't ideal behaviour as it should back out into the previous app if launched from an intent - maybe you could try starting a new activity with a flag to clear the stack and then immediately calling finish() on that activity.

@Override

public void onBackPressed() {

    Intent homeIntent = new Intent(Intent.ACTION_MAIN);

    homeIntent.addCategory(Intent.CATEGORY_HOME);

    homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    startActivity(homeIntent);
}

@janheinrichmerker janheinrichmerker changed the title How CAn I Star new activity when click finish button or last slide How can I start a new activity when I click the finish button or reach the last slide Mar 30, 2016
@janheinrichmerker janheinrichmerker added this to the Release 1.4 milestone Mar 30, 2016
@janheinrichmerker
Copy link
Owner

@daniel-stoneuk I'll look at this tomorrow

@janheinrichmerker janheinrichmerker self-assigned this Apr 2, 2016
@janheinrichmerker
Copy link
Owner

Possibly fixed by #36 if you listen for the Intent result

@trikhatarun
Copy link

trikhatarun commented Aug 18, 2017

Although using finish() works but it breaks the flow and for a moment the app is closed and then the next activity opens. The flow is not continuous and the intro activity resumes the activity it was called from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants