Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8968791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:30:11+00:00 2026-06-15T17:30:11+00:00

I’m writing an app with an autoplay feature, basically like a story book. I

  • 0

I’m writing an app with an autoplay feature, basically like a story book. I set a media player onCompletionListener for each activity (page) so that when the narration is done, it starts the next activity (page). There’s an option to turn autoplay off (so you can read it at your own pace)…but turning it off results in the activity –the current page– “remembering” the previous onCompletionListener call (as the back button is used to navigate back to the previous activity). The ensuing activities (pages) work fine…as the logic check that starts the onCompletionListener keeps it from being executed.

I’ve also tried moving that logic check to onStart() [instead of onCreate] as the menu where autoplay is toggled takes over the full screen and causes the previous activity (page) to execute onStop(). While this setup keeps the onCompletionListener from being executed again…it still doesn’t “cancel” the previous onCompletionListener. Note: This is only an issue when an activity (page) has been started with the autoplay=on.

I have also briefly tried super.recreate() for that particular activity in an attempt to “restart” everything (hopefully, including the onCompletionListener). However, the result was not pretty (activity blanked out and never reinitialized).

I didn’t include any code as (to me) this is more of a procedural question. 1. can a onCompletionListener be “canceled”. If so, how? 2. If not, (since I’m relatively new to java/android) is the recreate method acceptable/beneficial to “reset” the entire activity (and the onCompletionListener inside it)?

I’m targeting API 11 and above. Any thoughts/constructive criticism would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:30:12+00:00Added an answer on June 15, 2026 at 5:30 pm

    if you want to cancel a previous setted onCompletionListener, you can simply set a new one that does nothing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an app with both english and french support. The app requests
I am writing an app for my school newspaper, which is run completely online
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.