public class Position extends Activity {
    /** Called when the activity is first created. */
 
 AnimationDrawable ani;
 int x, y;
 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.map);
       
        final ImageView map = (ImageView) findViewById(R.id.img_map);
               
        Button exit = (Button)findViewById(R.id.map_exit);
        exit.setVisibility(View.GONE);

  BitmapDrawable drawable = (BitmapDrawable) getResources().getDrawable(
    R.drawable.map);
  Bitmap bm = drawable.getBitmap().copy(Config.ARGB_8888, true);    

  /*Intent intent = getIntent();  
  
  x=intent.getIntExtra("posX", 10);
  y=intent.getIntExtra("posY", 10);*/
  
  x=458;
  y=222;  

  for (int i = x - 4; i < x + 5; i++) {
   for (int j = y - 4; j < y + 5; j++) {
    bm.setPixel(i, j, Color.argb(255, 0, 255, 0));
   }
  }
  
  Drawable drawable2 = (Drawable) new BitmapDrawable(bm);
  
  ani = new AnimationDrawable();
  ani.addFrame(getResources().getDrawable(R.drawable.map), 500);
  ani.addFrame(drawable2, 1000);
  
  ani.setOneShot(false);
  
  map.setBackgroundDrawable(ani);
  //map.post(new Starter());

  //map.setImageBitmap(bm);  
    }
   
    class Starter implements Runnable {
     public void run()
     {
      ani.start();
     }   
    }
   
    public void onWindowFocusChanged(boolean hasFocus) {
             
     // TODO Auto-generated method stub            
     super.onWindowFocusChanged(hasFocus);
     
     ani.start();
     
     /*ImageView m = (ImageView) findViewById(R.id.img_map);
     m.setBackgroundDrawable(ani);
  m.post(new Starter());*/
     
     /*Thread t= new Thread(new Starter());     
     t.run();*/        
    } 
}

위 소스코드는 리소스에 있는 원본 파일을 읽어 와서 원본 파일과 픽셀을 수정한 파일 두개의 파일을 이용해서 에니메이션으로 나타낼려는 코드 인데요 의도한 데로 동작 하지 않네요

인터넷 검색을 통해서 나름 맞게 코딩한거 같은데 제대로 동작하지 않는 이유를 모르겠네요

뭐가 문제 일까요? 답변 좀 부탁 드립니다...