Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.d_logicnfc;
- /*
- @Author: Aleksandar Arsic
- @Description: Splash screen class. Loading webview animation from HTML file
- @Date created: 23/07/2017 (dd/mm/yyyy)
- */
- import android.app.Activity;
- import android.content.Context;
- import android.content.Intent;
- import android.graphics.Color;
- import android.os.Handler;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.view.View;
- import android.view.Window;
- import android.view.WindowManager;
- import android.webkit.WebSettings;
- import android.webkit.WebView;
- import android.widget.RelativeLayout;
- import d_logic.translator.Translator;
- import d_logic.translator.TranslatorException;
- public class AnimationActivity extends Activity {
- WebView imageWebView;
- Context thisContext = this;
- private IbfmFactory IbfmFactory;
- private Translator translator;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- //Remove title bar
- this.requestWindowFeature(Window.FEATURE_NO_TITLE);
- //Remove notification bar
- this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
- setContentView(R.layout.activity_animation);
- imageWebView = (WebView) findViewById(R.id.imageWebView);
- imageWebView.loadUrl("file:///android_asset/loading.html"); //Animated Gif
- IbfmFactory = new IbfmFactory(this);
- try{
- Translator.kill();
- Translator.setAPI_IDENTIFIER("D-LogicBUScontrol.apk");
- Translator.init(getApplicationContext());
- translator = Translator.getInstance();
- } catch (TranslatorException e1) {
- finish();
- }
- new DSetupAsyncTask(thisContext, translator).execute(IbfmFactory.getDSetupByteArray());
- //Wait 3 seconds before it starts LoginActivity
- Handler handler = new Handler();
- handler.postDelayed(new Runnable() {
- public void run() {
- // Intent intent = new Intent(getBaseContext(), New_card_control.class); test
- Intent intent = new Intent(getBaseContext(), LoginActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- finish();
- }
- }, 5000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement