/*
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/>.
Copyright 2015 Jose A. Gonzalez Cervera
Copyright 2015 Juan A. Fernández Sánchez
*/
package butterflydevs.brainstudio;
import android.content.Context;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.view.Menu;
import android.view.MenuItem;
import java.util.Timer;
import java.util.TimerTask;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import butterflydevs.brainstudio.extras.utilidades;
public class SplashScreenActivity extends Activity {
// Set the duration of the splash screen
private static final long SPLASH_SCREEN_DELAY = 3000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set portrait orientation
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
// Hide title bar
requestWindowFeature(Window.FEATURE_NO_TITLE);
//Con esta hacemos que la barra de estado del teléfono no se vea y la actividad sea a pantalla completa.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_splash_screen);
TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
System.out.println("ID telefono"+telephonyManager.getDeviceId());
TimerTask task = new TimerTask() {
@Override
public void run() {
// Start the next activity
Intent mainIntent = new Intent().setClass(
SplashScreenActivity.this, ActividadPrincipal.class);
startActivity(mainIntent);
// Close the activity so the user won't able to go back this
// activity pressing Back button
finish();
}
};
utilidades.cargarColorFondo(this);
// Simulate a long loading process on application startup.
Timer timer = new Timer();
timer.schedule(task, 1500);
}
}