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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:08:29+00:00 2026-06-15T14:08:29+00:00

I have the following code: package com.example.top_tech_deals; import android.app.Activity; import android.content.Intent; import android.media.MediaPlayer; import

  • 0

I have the following code:

package com.example.top_tech_deals;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.view.MotionEvent;
import android.widget.VideoView;

public class Splash extends Activity{



@Override
protected void onCreate(Bundle TravisLoveBacon) {
    // TODO Auto-generated method stub
    super.onCreate(TravisLoveBacon);
    setContentView(R.layout.splash);




VideoView vv = (VideoView)this.findViewById(R.id.videoView);

String fileName = "android.resource://" + getPackageName() + "/" + R.raw.splashvid2;

vv.setVideoURI(Uri.parse(fileName));

vv.start();


    Thread timer = new Thread(){
        public void run(){
            try{
                sleep(12000);

            } catch(InterruptedException e){
                e.printStackTrace();

            } finally{
                Intent openStartingPoint = new Intent     ("android.intent.action.MENU");
                startActivity(openStartingPoint);

            }
        }

    };
    timer.start();
}


//Function that will handle the touch

@Override

public boolean onTouchEvent(MotionEvent event) {

        if (event.getAction() == MotionEvent.ACTION_DOWN) {

            synchronized(timer){

                splashTread.notifyAll();

            }

        }

        return true;
    }


}

By using one of Bucky’s tutorials I managed to create the above code which is used to create a splash screen for 12 seconds. I also modified it so that a Video will play. The main problem I’m having is with the last bit of the code which is the OnTouchEvent I found online. What it should do is allow the user to skip the splash screen simply by tapping the screen, which should take the user to the MENU file.

The error seems to be in this line:

synchronized(timer){

Which says “error timer cannot be resolved into a variable”

Why is this happening and how can I fix it? Thanks for the help.

  • 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-15T14:08:30+00:00Added an answer on June 15, 2026 at 2:08 pm

    See code:

    package com.example.top_tech_deals;
    
    import android.app.Activity;
    import android.content.Intent;
    import android.media.MediaPlayer;
    import android.net.Uri;
    import android.os.Bundle;
    import android.view.MotionEvent;
    import android.widget.VideoView;
    
    public class Splash extends Activity{
    
    Thread timer;
    
    @Override
    protected void onCreate(Bundle TravisLoveBacon) {
        // TODO Auto-generated method stub
        super.onCreate(TravisLoveBacon);
        setContentView(R.layout.splash);
    
    
    
    
    VideoView vv = (VideoView)this.findViewById(R.id.videoView);
    
    String fileName = "android.resource://" + getPackageName() + "/" + R.raw.splashvid2;
    
    vv.setVideoURI(Uri.parse(fileName));
    
    vv.start();
    
    
        timer = new Thread(){
            public void run(){
                try{
                     synchronized (this) {
            wait(12000);
             }
    
                } catch(InterruptedException e){
                    e.printStackTrace();
    
                } finally{
                    Intent openStartingPoint = new Intent     ("android.intent.action.MENU");
                    startActivity(openStartingPoint);
    
                }
            }
    
        };
        timer.start();
    }
    
    
    //Function that will handle the touch
    
    @Override
    
    public boolean onTouchEvent(MotionEvent event) {
    
            if (event.getAction() == MotionEvent.ACTION_DOWN) {
    
                synchronized(timer){
    
                    timer.notify();
    
                }
    
            }
    
            return true;
        }
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an IFile with the following content: package com.example; //@SimpleAnnotation(Blab.ckass) //@CustomAnnotation(arg1 = Blup.class
Code I have the following class with a member interface: package com.example.withinterface; public class
I have following Code package cyclist.project; import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONException;
I have the following simple Java code: package testj; import java.util.*; public class Query<T>
Please have a look at the following code package Euler; import java.util.ArrayList; import java.util.List;
Please have a look at the following code activity_main.xml <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:tools=http://schemas.android.com/tools android:layout_width=match_parent android:layout_height=match_parent
I'm going by the following code example to dynamically build a preference activity. http://www.linuxtopia.org/online_books/android/devguide/guide/samples/ApiDemos/src/com/example/android/apis/app/PreferencesFromCode.html
I have a scala object defined like the following: package com.example object Foo {
Please have a look at the following code activity_main.xml <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:tools=http://schemas.android.com/tools android:layout_width=match_parent android:layout_height=match_parent
Suppose I have following code package memoryleak; public class MemoryLeak { public static int

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.