On Sep 1, 11:06 am, Jhew SAN <[email protected]> wrote:
> Logcat say error this line  viewInfo.removeViewAt(positionToRemove);
>
> final ListView viewInfo = (ListView)findViewById(R.id.listView1);
>         final SWFForeCastInfoLayoutAdapter adapter = new
> SWFForeCastInfoLayoutAdapter(this, data, data.getCurrentConditionData());
>         viewInfo.setAdapter(adapter);
>         adapter.notifyDataSetChanged();
>         viewInfo.setOnItemClickListener(new OnItemClickListener() {
>  @Override
> public void onItemClick(AdapterView<?> a, View v, final int position, long
> id) {
>         AlertDialog.Builder adb=new
> AlertDialog.Builder(SearchActivity.this);
>         adb.setTitle("Delete?");
>         adb.setMessage("Are you sure you want to delete " + position);
>         final int positionToRemove = position;
>         adb.setNegativeButton("Cancel", null);
>         adb.setPositiveButton("Ok", new AlertDialog.OnClickListener() {
>
> @Override
> public void onClick(DialogInterface dialog, int which) {
> // TODO Auto-generated method stub
> viewInfo.removeViewAt(positionToRemove);
>                 adapter.notifyDataSetChanged();}});
>
>         adb.show();
>         }
>     });
>
> any body help?
>
> best regard;


change your adapter's data set and then notify data set changed

pskink

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to