Android Open Source - Android_Speech_To_Text_Clipboard_Widget Splash






From Project

Back to project page Android_Speech_To_Text_Clipboard_Widget.

License

The source code is released under:

GNU General Public License

If you think the Android project Android_Speech_To_Text_Clipboard_Widget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
        Copyright (C) <2014>  <Patrick Gray MacDowell>
//from w  ww  . j  av a 2  s.c o  m
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
package com.pgmacdesign.speechtotextclipboardwidget;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.preference.PreferenceManager;

public class Splash extends Activity {

MediaPlayer ourIntroSong, doorClose; //Doorclose not used at this point, will setup for transitional sound at some point
  
  @Override
  protected void onCreate(Bundle inputVariableToSendToSuperClass) {

    super.onCreate(inputVariableToSendToSuperClass);
    setContentView(R.layout.splash);
    
    ourIntroSong = MediaPlayer.create(Splash.this, R.raw.cinematic_impact);
    ourIntroSong.start();
    
    Thread timer = new Thread()
    {
      public void run()
      {
        try
        {
          //In Milliseconds, set to 3 seconds at this point
          sleep(3000);
        } catch (InterruptedException e01) {
          String error_in_splash = e01.toString(); //For Debugging purposes
          e01.printStackTrace();
        } finally {
          Intent openMain = new Intent(Splash.this, MainActivity.class);
          startActivity(openMain);
        }
      }
    };

    timer.start();
    
  }

  @Override
  protected void onPause() {
    super.onPause();
    
    //This kills the music so it isn't carried over between splash screens
    ourIntroSong.release();
    
    //Destroys the class when it goes on pause. Not ideal for most programs, but, for a splash screen, this works fine as we don't want it to show up again. 
    finish(); 
  }  
}




Java Source Code List

com.pgmacdesign.speechtotextclipboardwidget.L.java
com.pgmacdesign.speechtotextclipboardwidget.MainActivity.java
com.pgmacdesign.speechtotextclipboardwidget.MyWidget1.java
com.pgmacdesign.speechtotextclipboardwidget.SadPanda.java
com.pgmacdesign.speechtotextclipboardwidget.SharedPrefs.java
com.pgmacdesign.speechtotextclipboardwidget.SpeechToText.java
com.pgmacdesign.speechtotextclipboardwidget.Splash.java
com.pgmacdesign.speechtotextclipboardwidget.WidgetConfig.java