package com.dahamit.dahammall;


import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.dahamit.dahammall.util.Util;

public class NoWifiActivity extends Activity {
    TextView tvTitle;//, tvOwner;
    Context thisCtx;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_nowifi);
        thisCtx = this;
        RelativeLayout introLayout = (RelativeLayout)this.findViewById(R.id.activity_main);
        introLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(Util.isNetWork(thisCtx)){
                    startMainActivity();
                }
            }
        });
    }
    public void startMainActivity() {
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            public void run() {
                Intent intent = new Intent(NoWifiActivity.this, MainActivity.class);
                //intent.putExtra("menuid", FragmentId.MAIN_FRAG);
                startActivity(intent);
                finish();
            }
        }, 2000);
    }
}
