SHARE
TWEET

Untitled

a guest May 26th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.rayen.testfirebase.activities;
  2.  
  3. import android.os.Bundle;
  4. import android.support.v7.app.AppCompatActivity;
  5. import android.view.WindowManager;
  6.  
  7. import com.rayen.testfirebase.Helpers.Session;
  8. import com.rayen.testfirebase.R;
  9.  
  10. public class SplashActivity extends AppCompatActivity {
  11.  
  12.  
  13.     @Override
  14.     protected void onCreate(Bundle savedInstanceState) {
  15.         super.onCreate(savedInstanceState);
  16.         getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
  17.                 WindowManager.LayoutParams.FLAG_FULLSCREEN);
  18.                 setContentView(R.layout.activity_splash);
  19.  
  20.         session = new session(getApplicationContext());
  21.         new Handler().postDelayed(new Runnable() {
  22.             @Override
  23.             public void run() {
  24.  
  25.                 if(session.logged()){
  26. if(session.getType().equals("Admin"){
  27.                                 Intent intent = new Intent(LoginActivity.this, EmployesActivity.class);
  28. startActivity(intent);
  29.                                 finish();}
  30. if(session.getType().equals("Maintenance"){
  31.                                 Intent intent = new Intent(LoginActivity.this, AddReclamationActivity.class);
  32. startActivity(intent);
  33.                                 finish();}
  34. if(session.getType().equals("Demandeur"){
  35.                                 Intent intent = new Intent(LoginActivity.this, DemandeurActivity.class);
  36. startActivity(intent);
  37.                                 finish();}
  38. }
  39. else
  40. {
  41.                                 Intent intent = new Intent(LoginActivity.this, DemandeurActivity.class);
  42. startActivity(intent);
  43.                                 finish();}
  44.  
  45.             }
  46.         }, 5000);
  47.  
  48.  
  49. }
  50.  
  51. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top