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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:25:41+00:00 2026-06-07T02:25:41+00:00

I believe I have my code set up correctly but when I try to

  • 0

I believe I have my code set up correctly but when I try to debug it, after it transitions from the splash screen it just goes right to a black screen. I know I imported the layout correctly but it still goes black.

This is the code for the splash screen

package com.example.equate.jones;



import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;

public class EJ_Splash extends Activity {

    protected boolean _active = true;
    protected int _splashTime = 3000;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ej__splash);

        // thread for displaying the SplashScreen
        Thread splashTread = new Thread() {
            @Override
            public void run() {
                try {
                        synchronized(this){
                            wait(4000);
                        }

                    }
                 catch(InterruptedException e) {
                    // do nothing
                } {

                    finish();

                    Intent i = new Intent(getApplicationContext(),EJ_Board.class);
                    startActivity(i);
                }
            }
        };
        splashTread.start();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_ej__splash, menu);
        return true;
    }


}

This is the code for the screen it is supposed to transition to.

package com.example.equate.jones;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

public class EJ_Board extends Activity {

    private ImageView button1;
    final MediaPlayer mp = MediaPlayer.create(this, R.raw.warm);

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ej_board);


        button1=(ImageView)findViewById(R.id.imageView1);

        button1.setOnClickListener(new View.OnClickListener() 
        { 
            public void onClick(View view) 
            { 

                mp.start(); 
            }
        });
    }

}

This is the xml for EJ_Board

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher" />

</LinearLayout>
  • 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-07T02:25:42+00:00Added an answer on June 7, 2026 at 2:25 am

    I think your problem is with the ImageView. You need to add an image to your drawable folder, then change your android:src="@drawable/ic_launcher" to the name of the image you saved. This will give you the image you need for your button. Hope that helps

    Edit:

    For your splash screen, try something like this:

    public class SplashActivity extends Activity  {
       private long splashDelay = 5000;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.splash);
    
            TimerTask task = new TimerTask()
            {
    
                @Override
                public void run() {
                    finish();
                    Intent homeIntent = new Intent().setClass(SplashActivity.this, HomeActivity.class);
                    startActivity(homeIntent);
    
                }
    
            };
    
            Timer timer = new Timer();
            timer.schedule(task, splashDelay);
    
        }
    }
    

    Then in your home activity you can set your menu:

    public class HomeActivity extends Activity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            // TODO Auto-generated method stub
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
        }
        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
            MenuInflater inflater = getMenuInflater();
            inflater.inflate(R.layout.menu, menu);
            return true;
        }
    
        @Override
        public boolean onOptionsItemSelected(MenuItem item) {
            // Handle item selection
            switch (item.getItemId()) {
                case R.id.locationButton:
                    Intent locationIntent = new Intent(this, LocationActivity.class);
                    startActivity(locationIntent);
                    return true;
                case R.id.diningButton:
                    Intent diningIntent = new Intent(this, DiningActivity.class);
                    startActivity(diningIntent);
                    return true;
    
                case R.id.topXXVButton:
                    Intent topIntent = new Intent(this, DiningActivity.class);
                    startActivity(topIntent);
                    return true;
    
                default:
                    return super.onOptionsItemSelected(item);
            }
        }
    }
    

    Try this:

    public class SplashActivity extends Activity  {
       private long splashDelay = 5000;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.splash);
    
            TimerTask task = new TimerTask()
            {
    
                @Override
                public void run() {
                    finish();
                    Intent mainIntent = new Intent().setClass(EJ_Splash.this, EJ_Board.class);
                    startActivity(mainIntent);
    
                }
    
            };
    
            Timer timer = new Timer();
            timer.schedule(task, splashDelay);
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with some code and I believe it is because of
I have a very strange bug, which I believe is caused by some code
So, i have this code that seems to be doing the mechanical work correctly,
We have just upgraded from Microsoft Dynamics CRM 4 to Microsoft Dynamics CRM 2011.
I believe I have disabled the view state on all controls as well as
I believe I have a potential threading issue. I have a user control that
I believe I have found a weird bug as follow: I want to delete
This is staight forward I believe: I have a table with 30,000 rows. When
Can MlPy / SciPy be used on GAE? I believe I have imported NumPy
I've recently been trying to port a C++ application. I believe I have all

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.