tags:

views:

50

answers:

0

I have a a list view that shows:

tag : 10 tagb : 20

When I click on an item, I get an Alert asking to change a value (EditText) I set the value and click ok

  1. How can I refresh the listview to show the change
  2. How can I manually change the row and put the new value there eg tagb : 122?

BTW, The list of itemsand value comes from a result of a REST call I make to a server

Hope this makes sense.

Thanks

Here is the code for the ListView:

setContentView(R.layout.listview); list = (ListView) findViewById(R.id.list);

    adapter = new ListViewAdapter(this, alarmName, deviceName, alarmDate,
            alarmSev);
    list.setAdapter(adapter);
    adapter.notifyDataSetChanged();
    list.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                long arg3) {
            // TODO Auto-generated method stub
            AlertDialog.Builder adb = new AlertDialog.Builder(
                    AlarmsTab.this);

            adb.setTitle("Acknowledge Alarms");

            adb.setMessage("Do you want to Acknowledge this Alarm? " + "\n"
                    + alarmName.get(arg2));
            alarmpos = alarmName.get(arg2);

            adb.setPositiveButton("Yes",
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {

                            CloseAlarm(asset, model, alarmpos);

                        }
                    });
            adb.setNegativeButton("No",
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            dialog.cancel();
                        }
                    });

            adb.show();

        }

    });

    getAlarmsForAsset(asset);
    adapter.notifyDataSetChanged();

}