自定义适配器用来显示wifi列表,但是红色字体部分报错,强转为String运行时报空指针错误,估计是类型的转换有有关问题,哪位大神帮忙给新手指导指导

自定义适配器用来显示wifi列表,但是红色字体部分报错,强转为String运行时报空指针异常,估计是类型的转换有问题,哪位大神帮忙给新手指导指导
public class GuideWifiActivity extends Activity {
private final static String TAG = "HKLauncher";
private String wifiPassword = null;
private Button wifiSearchButton;
private Button sureSetting;
private WifiUtils localWifiUtils;
private List<ScanResult> wifiResultList;
private List<String> wifiListString = new ArrayList<String>();
private ListView wifiSearchListView;
private WifiManager wifiManager;
private MyAdapter mAdapter;
private static final int wifiscan=0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.guide_network_wifi);

wifiSearchButton = (Button)findViewById(R.id.guide_network_wifi_switch);
sureSetting = (Button) findViewById(R.id.wifi_set_next);
wifiSearchListView = (ListView)findViewById(R.id.wifi_ssid_listview);
localWifiUtils = new WifiUtils(GuideWifiActivity.this);
init();
ListOnItemClickListener wifiListListener = new ListOnItemClickListener();
wifiSearchListView.setOnItemClickListener(wifiListListener);
sureSetting.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setClass(GuideWifiActivity.this,GuideUserPhoneNumActivity.class);
startActivity(intent);
}
});

}


private void init() {
wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wifiListString.clear();
openWifi();
wifiResultList = wifiManager.getScanResults();
ListView listView = (ListView) findViewById(R.id.wifi_ssid_listview);
mAdapter = new MyAdapter(this,wifiResultList);
if (wifiResultList == null) {
Toast.makeText(this, "wifi未打开!", Toast.LENGTH_LONG).show();
}else {
if(wifiListString != null){
Log.i("WIFIButtonListener","dataChange");
scanResultToString(wifiResultList,wifiListString);
}
listView.setAdapter(mAdapter);
}
}


private void openWifi() {
if (!wifiManager.isWifiEnabled()) {
wifiManager.setWifiEnabled(true);
}
}



public class ListOnItemClickListener implements OnItemClickListener{
String wifiItemSSID = null;
private View selectedItem;
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
Log.i("ListOnItemClickListener","start");
selectedItem = arg1;
arg1.setBackgroundResource(R.color.gray);
String wifiItem = mAdapter.getItem(arg2);
String []ItemValue = wifiItem.split("--");
wifiItemSSID = ItemValue[0]; 
int wifiItemId = localWifiUtils.IsConfiguration("\""+wifiItemSSID+"\"");
if(wifiItemId != -1){
TextView textview = (TextView) findViewById(R.id.connect_hint);
if(localWifiUtils.ConnectWifi(wifiItemId)){
arg1.setBackgroundResource(R.color.green);
textview.setText("已连接");
}else{
textview.setText("");
}
}
else{
WifiPswDialog pswDialog = new WifiPswDialog(GuideWifiActivity.this,new OnCustomDialogListener() {

@Override
public void back(String str) {
wifiPassword = str;
if(wifiPassword != null){
int netId = localWifiUtils.AddWifiConfig(wifiResultList,wifiItemSSID, wifiPassword);
Log.i("WifiPswDialog",String.valueOf(netId));
if(netId != -1){
localWifiUtils.getConfiguration();
if(localWifiUtils.ConnectWifi(netId)){
selectedItem.setBackgroundResource(R.color.green);
Intent intent = new Intent();
intent.setClass(GuideWifiActivity.this,GuideUserPhoneNumActivity.class);
startActivity(intent);
}
}
else{
Toast.makeText(GuideWifiActivity.this, "网络连接错误", Toast.LENGTH_SHORT).show();
selectedItem.setBackgroundResource(R.color.blue);
}
}
else{
selectedItem.setBackgroundResource(R.color.blue);
}
}
});

pswDialog.show();
}
}
}

public class MyAdapter extends BaseAdapter {
LayoutInflater inflater;
List<ScanResult> list;
public MyAdapter(Context context, List<ScanResult> list) {
// TODO Auto-generated constructor stub
this.inflater = LayoutInflater.from(context);
this.list = list;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return list.size();
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
View view = null;
view = inflater.inflate(R.layout.wifi_list_item, null);
ScanResult scanResult = list.get(position);
TextView textView = (TextView) view.findViewById(R.id.ssid);
textView.setText(scanResult.SSID);
TextView isConn = (TextView) view.findViewById(R.id.connect_hint);
isConn.setText("");
ImageView imageView = (ImageView) view.findViewById(R.id.iv);
//判断信号强度,显示对应的指示图标
if (Math.abs(scanResult.level) > 100) {
imageView.setImageDrawable(getResources().getDrawable(R.drawable.wifi_lock_signal_0));
} else if (Math.abs(scanResult.level) > 80) {
imageView.setImageDrawable(getResources().getDrawable(R.drawable.wifi_lock_signal_1));
} else if (Math.abs(scanResult.level) > 70) {
imageView.setImageDrawable(getResources().getDrawable(R.drawable.wifi_lock_signal_1));
} else if (Math.abs(scanResult.level) > 60) {
imageView.setImageDrawable(getResources().getDrawable(R.drawable.wifi_lock_signal_2));
} else if (Math.abs(scanResult.level) > 50) {
imageView.setImageDrawable(getResources().getDrawable(R.drawable.wifi_lock_signal_2));
} else {
imageView.setImageDrawable(getResources().getDrawable(R.drawable.wifi_lock_signal_3));
}
return view;
}
}

}

------解决思路----------------------
你的adapter返回的是int类型的,不报错才怪
------解决思路----------------------
你adapter中的getitem方法里面应该是list.get(position)..得到一个对象,然后再取你要的值。