아;;;;보름넘게 해결을 못하고 있네요 ㅠㅠㅠㅠㅠㅠㅠㅠ

리스트 액티비티로 수신함전체를 불러왔는데요 

추가적으로 버튼을이용하여 여지껏받았던 메시지를 삭제하고싶은데

삭제 하는부분이 자꾸 꼬여서 안되네요 ㅠㅠㅠㅠ

코딩상에 에러는 없는듯 보이는데 컴파일하게되면 에뮬레이터 상에서 에러가 뜨는데 원인을 모르겠네요 ㅠㅠㅠ

고수님 도와주세요 ㅠㅠㅠㅠㅠ

package pro.android;

import java.util.ArrayList;

import android.app.ListActivity;
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;

import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Toast;


public class UnNagActivity extends ListActivity
{
 //private ListAdapter adapter;
 ArrayList<String> list;
 ArrayAdapter<String> adapter;
 private Button delete;
 private static final Uri SMS = Uri.parse("content://sms/inbox");
 @Override
 public void onCreate(Bundle buldle)
 {
  super.onCreate(buldle);
  setContentView(R.layout.main);
    
  Cursor c = getContentResolver().query(SMS, null, null, null, null);  
  startManagingCursor(c);
  String[] columns = new String[] {"body"};
  //String [] names = new String [] {R.id.row};
  list = new ArrayList<String>();
    
  delete = (Button)findViewById(R.id.delete_button); // 버튼 생성 
    
  delete.setOnClickListener(new Button.OnClickListener()
  {
   @Override
   public void onClick(View v)
   {
    deleteNags();   
   }

   private void deleteNags()
   {
    ContentResolver cr = getContentResolver();
    Uri SMS = Uri.parse( "content://sms/inbox" );   
    Cursor cursor = cr.query(SMS, new String[] { "_id", "thread_id", "body" }, null, null, null);
    if (cursor == null)
     return;
    if (!cursor.moveToFirst())     
     return;   
    int count = 0;   
    do
    {     
     String body = cursor.getString( 2 );     
     
     if( body.indexOf( "FRM:nagios@" ) == -1 )       
      continue;     
     long thread_id = cursor.getLong( 1 );     
     Uri thread = Uri.parse( "content://sms/conversations/" + thread_id );     
     cr.delete( thread, null, null );     
     count++;   
    }  
    //getContentResolver().delete(Uri.parse("content://sms/conversations/" + thread_id),null,null);

    while ( cursor.moveToNext() );   
    message( "Deleted: " + count ); 
       
  }

   private void message(String msg )  // 마지막 출력부분 
   {   
    Context context = getApplicationContext();   
    CharSequence text = msg;   
    Toast toast = Toast.makeText( context, text, Toast.LENGTH_SHORT );   
    toast.show();
   };
   
  });
  adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, list);
     setListAdapter(adapter);
     adapter.notifyDataSetChanged();
 }
 
}