Advertisement
ProgrameruPokusaju

test

Jul 10th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.45 KB | None | 0 0
  1. package com.example.d_logicnfc;
  2.  
  3. /*
  4. @Author: Aleksandar Arsic
  5. @Description: Splash screen class. Loading webview animation from HTML file
  6. @Date created: 23/07/2017 (dd/mm/yyyy)
  7.  */
  8.  
  9. import android.app.Activity;
  10. import android.content.Context;
  11. import android.content.Intent;
  12. import android.graphics.Color;
  13. import android.os.Handler;
  14. import android.support.v7.app.AppCompatActivity;
  15. import android.os.Bundle;
  16. import android.view.View;
  17. import android.view.Window;
  18. import android.view.WindowManager;
  19. import android.webkit.WebSettings;
  20. import android.webkit.WebView;
  21. import android.widget.RelativeLayout;
  22.  
  23. import d_logic.translator.Translator;
  24. import d_logic.translator.TranslatorException;
  25.  
  26. public class AnimationActivity extends Activity {
  27.         WebView imageWebView;
  28.     Context thisContext = this;
  29.     private IbfmFactory IbfmFactory;
  30.     private Translator translator;
  31.     @Override
  32.     protected void onCreate(Bundle savedInstanceState) {
  33.         super.onCreate(savedInstanceState);
  34.  
  35.         //Remove title bar
  36.         this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  37.         //Remove notification bar
  38.         this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
  39.  
  40.  
  41.                 setContentView(R.layout.activity_animation);
  42.  
  43.                 imageWebView = (WebView) findViewById(R.id.imageWebView);
  44.                 imageWebView.loadUrl("file:///android_asset/loading.html"); //Animated Gif
  45.         IbfmFactory = new IbfmFactory(this);
  46.         try{
  47.             Translator.kill();
  48.             Translator.setAPI_IDENTIFIER("D-LogicBUScontrol.apk");
  49.             Translator.init(getApplicationContext());
  50.             translator = Translator.getInstance();
  51.         } catch (TranslatorException e1) {
  52.             finish();
  53.         }
  54.  
  55.  
  56.  
  57.             new DSetupAsyncTask(thisContext, translator).execute(IbfmFactory.getDSetupByteArray());
  58.         //Wait 3 seconds before it starts LoginActivity
  59.         Handler handler = new Handler();
  60.         handler.postDelayed(new Runnable() {
  61.             public void run() {
  62.                 // Intent intent = new Intent(getBaseContext(), New_card_control.class); test
  63.                 Intent intent = new Intent(getBaseContext(), LoginActivity.class);
  64.                 intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  65.                 startActivity(intent);
  66.                 finish();
  67.  
  68.             }
  69.         }, 5000);
  70.  
  71.  
  72.  
  73.     }
  74.  
  75.  
  76.  
  77.  
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement