I've created an application that stores information inputted by the user in my SQLite database however when I attempt implement a function to save the currently connected SSID as well - the app fails to save or display the currently connected SSID - instead it saves and displays the data inputted by the user via the XML EditText @+id/nameEdit which I do not want. How can I remove this manual input and input the SSID automatically? I gave it my best shot below - but I know I'm missing something to get it working properly. JAVA:\[code\]import android.app.Activity;import android.app.AlertDialog;import android.os.AsyncTask;import android.os.Bundle;import android.view.ViewGroup;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.FrameLayout;import android.widget.TimePicker;import java.text.DecimalFormat;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.net.ConnectivityManager;import android.net.NetworkInfo;import android.net.wifi.WifiInfo;import android.net.wifi.WifiManager;import android.widget.TextView;public class AddEditDevice extends Activity { private long rowID; private EditText nameEt; private EditText capEt; private EditText codeEt; private TimePicker timeEt; // DecimalFormat df = new DecimalFormat ("00"); // public String minutes = df.format(min); public void run() { WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = wifi.getConnectionInfo(); String nameEdit = info.getSSID(); } // @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.add_country); nameEt = (EditText) findViewById(R.id.nameEdit); capEt = (EditText) findViewById(R.id.capEdit); codeEt = (EditText) findViewById(R.id.codeEdit); timeEt = (TimePicker) findViewById(R.id.timeEdit); Bundle extras = getIntent().getExtras(); if (extras != null) { rowID = extras.getLong("row_id"); nameEt.setText(extras.getString("name")); capEt.setText(extras.getString("cap")); codeEt.setText(extras.getString("code")); String time = extras.getString("time"); String[] parts = time.split(":"); timeEt.setCurrentHour(Integer.valueOf(parts[0])); timeEt.setCurrentMinute(Integer.valueOf(parts[1])); timeEt.setIs24HourView(false); } Button saveButton = (Button) findViewById(R.id.saveBtn); saveButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { if (nameEt.getText().length() != 0) { AsyncTask<Object, Object, Object> saveContactTask = new AsyncTask<Object, Object, Object>() { @Override protected Object doInBackground(Object... params) { saveContact(); return null; } @Override protected void onPostExecute(Object result) { finish(); } }; saveContactTask.execute((Object[]) null); } else { AlertDialog.Builder alert = new AlertDialog.Builder( AddEditDevice.this); alert.setTitle(R.string.errorTitle); alert.setMessage(R.string.errorMessage); alert.setPositiveButton(R.string.errorButton, null); alert.show(); } } }); } private void saveContact() { DatabaseConnector dbConnector = new DatabaseConnector(this); if (getIntent().getExtras() == null) { dbConnector.insertContact(nameEt.getText().toString(), capEt .getText().toString(), timeEt.getCurrentHour().toString() + ":" + timeEt.getCurrentMinute().toString(), codeEt .getText().toString()); } else { dbConnector.updateContact(rowID, nameEt.getText().toString(), capEt .getText().toString(), timeEt.getCurrentHour().toString() + ":" + timeEt.getCurrentMinute().toString(), codeEt .getText().toString()); } }}\[/code\]XML:\[code\]<?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1"> <LinearLayout android:id="@+id/linearLayout" android:layout_width="fill_parent" android:layout_height="wrap_content" androidrientation="vertical" androidadding="5dp"> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Data Limit" android:textColor="#ffffff" android:textAppearance="?android:textAppearanceMedium" /> <SeekBar android:id="@+id/seekBar1" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" androidrientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="left" android:textColor="#ffffff" android:text="Unlimited Data" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="right" android:textColor="#ffffff" android:text="10MB" /> </LinearLayout> <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Bandwidth Limit" android:textColor="#ffffff" android:textAppearance="?android:textAppearanceMedium" /> <SeekBar android:id="@+id/seekBar1" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" androidrientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="left" android:textColor="#ffffff" android:text="Unlimited Bandwidth" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:textColor="#ffffff" android:gravity="right" android:text="10kbs" /> </LinearLayout> <EditText android:id="@+id/nameEdit" android:layout_width="fill_parent" android:layout_height="wrap_content" android:ems="10" android:hint="@string/name_hint" android:imeOptions="actionNext" android:inputType="textPersonName|textCapWords" /> <EditText android:id="@+id/capEdit" android:layout_width="fill_parent" android:layout_height="wrap_content" android:ems="10" android:hint="@string/cap_hint" android:imeOptions="actionNext" android:inputType="textPersonName|textCapWords" > <requestFocus /> </EditText> <EditText android:id="@+id/codeEdit" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0" android:ems="10" android:gravity="center" android:hint="@string/code_hint" android:imeOptions="actionNext" android:inputType="textUri" android:lines="1" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" androidrientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="center" android:textColor="#ffffff" android:text="Parental Controls" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="center" android:text="IPv6 SPI Firewall Protection" android:textColor="#ffffff" /> </LinearLayout><LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" androidrientation="horizontal" > <ToggleButton android:id="@+id/ToggleButton03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="center" android:text="ToggleButton" /> <ToggleButton android:id="@+id/ToggleButton03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="center" android:text="ToggleButton" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" androidrientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="center" android:text="Block Proxy Servers" android:textColor="#ffffff" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="center" android:textColor="#ffffff" android:text="IPv4 SPI Firewall Protection" /> </LinearLayout><LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" androidrientation="horizontal" > <ToggleButton android:id="@+id/ToggleButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="center" android:text="ToggleButton" /> <ToggleButton android:id="@+id/ToggleButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:gravity="center" android:text="ToggleButton" /> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" androidrientation="horizontal" android:layout_gravity="center" android:gravity="center"></LinearLayout> <TextView android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:textAppearanceSmall" /> <TextView android:id="@+id/TextView02" android:layout_width="wrap_content" android:layout_gravity="center" android:layout_weight="1.0" android:layout_height="wrap_content" android:text="WiFi Time Limit" android:layout_marginBottom="8dp" android:textColor="#ffffff" android:textAppearance="?android:textAppearanceMedium" /> <TimePicker android:id="@+id/timeEdit" android:layout_width="286dp" android:layout_height="wrap_content" android:layout_weight="1.0" android:layout_gravity="center_horizontal"/> <Button android:id="@+id/Button01" android:layout_width="199dp" android:layout_height="wrap_content" android:layout_marginTop="15dp" android:layout_gravity="center_horizontal" android:text="@string/save_btn" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" androidrientation="horizontal" > /></LinearLayout> <Button android:id="@+id/saveBtn" android:layout_width="199dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="15dp" android:text="@string/save_btn" /> </LinearLayout></ScrollView>\[/code\]