Commit dcd5ec60 authored by djamel's avatar djamel

active wifi s'il est desqctive

parent 2da4ac59
......@@ -3,6 +3,8 @@
package="djamelfel.gala" >
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<application
android:allowBackup="true"
......
package djamelfel.gala;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
......@@ -35,6 +37,9 @@ public class Login extends ActionBarActivity implements View.OnClickListener {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wifi.setWifiEnabled(true); // true or false to activate/deactivate wifi
_ipAddress = (EditText)findViewById(R.id.text_ipAddress);
_portNumber = (EditText)findViewById(R.id.text_port);
Button validateIPAddress = (Button) findViewById(R.id.button_ipAddress);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment