package com.epson.mobilephone.common.wifidirect;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;


public class ActivityWiFiDirectStart extends ActivityWiFiDirectBase {
    private static final int ID_ENABLEWIFI = 1;
    View viewiPrintConnect;

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView((int) R.layout.wifidirect_start);
        setupCommonHeaderControl(false, true);
        viewiPrintConnect = ((ViewGroup) findViewById(R.id.wifi_start_top)).findViewById(R.id.iprint_connect);
        viewiPrintConnect.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent intent = new Intent(ActivityWiFiDirectStart.this, ActivityControlWiFi.class);
                intent.putExtra(ActivityControlWiFi.SHOWPROGRESS, true);
                ActivityWiFiDirectStart.this.startActivityForResult(intent, 1);
            }
        });
        findViewById(R.id.width_lcd).setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                ActivityWiFiDirectStart.this.startWifiManualSetup(false);
            }
        });
        findViewById(R.id.no_lcd).setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                ActivityWiFiDirectStart.this.startWifiManualSetup(true);
            }
        });
    }

    private void startWifiManualSetup(boolean z) {
        startActivityForResult(ActivityWiFiDirectManual.getStartIntent(this, z), 10);
    }

    protected void onResume() {
        super.onResume();
    }

    protected void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 1 && i2 == -1) {
            startActivityForResult(new Intent(this, ActivityiPrintConnectStart.class), 10);
        }
    }
}
