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 9111171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:26:33+00:00 2026-06-17T03:26:33+00:00

First of all say that I don’t have much experience programming and that these

  • 0

First of all say that I don’t have much experience programming and that these are my first steps in Android.

I’ve developed an app for android, with minSdkVersion 8 and targetSdkVersion 16.

The application is like a photographic gallery that when you touch one of the pictures, shows a screen with a picture, a text, and play two sounds. You can view the previous or next screen sliding with your finger, or make it automatically sliding with some intervals.

I’ve tested the app in the emulator with android 2.2, and in some devices with android 2.3.5 and android 4.0.x.

With android 2.2 and 2.3.5 the app works correctly, but with android 4.0.x I’ve detected that the “manual” way works correctly, but the “automatic image sliding” doesn’t work.

The problem is that you select one of the pictures and the first activity runs correctly, but after the first one, the sounds of the next activity are heard before the layout of this activity is on the screen. If you exit to the main menu and choose other picture, the problem is the same. You see correctly the first activity and after that, the sounds advance the image of the activity.

I haven’t found nothing similar to my problem searching here. Can anyone help me?

EDITED to show some code.

The onCompletion code:

public void onCompletion(MediaPlayer mp) {
    if(mp.equals(mpNom)){
        try {
            Thread.sleep (mpNom.getDuration()+500);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }           

    }else if(mp.equals(mpSo)){
        try {
            Thread.sleep (mpSo.getDuration());
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
}
}

The application does’t show any error and neither crash, but the UI is shown when the sounds are already reproducing.

Any idea? Thanks in advance.

  • 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-17T03:26:34+00:00Added an answer on June 17, 2026 at 3:26 am

    Finally I’ve solved the problem.

    It seems that the problem was in the OnCompletion method or in the code inside this method.

    I rewrite the code making the app do the same but in a different way (programmaticaly talking), avoiding the OnCompletion method and now the app works perfect in android 4.0.x

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

Sidebar

Related Questions

First of all i want to say that i have searched each and every
First of all, I have to say that I'm going to talk about System.ComponentModel.Component
First of all, I would like to say that I have used the search
First, I have to say that I really like Groovy and all the good
Let me first say that I have quite a lot of Java experience, but
First of all, I want to say that I'm huge on theory. I don't
First of all i want to say that I'm still a beginner in ASP.NET
First of all I need to say that I'm new to jQuery. When I
First of all, let me say that I am not a professional coder -
First of all I have to say I am new to iOS development. My

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.