Preciso deletar um elemento do meu ListView e estou com problema meu codigo é esse
Host = new String[] { "Host1 ", "Host2", "Host3"};
Descricao = new String[] { "Estado do Host", "Estado do Host", "Host" };
Status = new String[]{"DOWN","UNREACHABLE","DOWN"};
adapter = new ListViewAdpterInicial(getActivity().getBaseContext(),Host,Descricao,Status);
list.setAdapter(adapter);
listviewAdpterInicial
public class ListViewAdpterInicial extends BaseAdapter {
Context context;
String[] Host;
String[] Descricao;
String[] Status;
public ListViewAdpterInicial(Context context, String[] host, String[] descricao, String[] status) {
this.context = context;
this.Host = host;
this.Descricao = descricao;
this.Status = status;
}
@Override
public int getCount() {
return Host.length;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
public View getView(int position, View convertView, ViewGroup parent) {
TextView txtHost;
TextView txtDescricao;
TextView txtStatus;
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View itemView = inflater.inflate(R.layout.texto_inicial_host, parent, false);
txtHost = (TextView) itemView.findViewById(R.id.txt_host_inicial);
txtDescricao = (TextView) itemView.findViewById(R.id.txt_host_descricao);
txtStatus = (TextView)itemView.findViewById(R.id.txt_host_status);
txtHost.setText(Host[position]);
txtDescricao.setText(Descricao[position]);
txtStatus.setText(Status[position]);
return itemView;
}}
Como eu poria fazer para ex: deletar o Elemento 2 dessa Lista