package asd.asd;

import java.io.*;

import android.app.*;
import android.content.*;
import android.graphics.*;
import android.os.*;
import android.util.*;
import android.view.*;
import android.widget.*;

public class Save extends Activity {
 SomeView sv;

 /** Called when the activity is first created. */

 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  sv = new SomeView(this);

  setContentView(sv);

 }

 @Override
 public boolean onKeyDown(int keyCode, KeyEvent event) {
  switch (event.getKeyCode()) {

  case KeyEvent.KEYCODE_DPAD_CENTER:

   if (sv != null) {
    saveView(sv);

    return true;
   }

  default:

  }

  return super.onKeyDown(keyCode, event);
 }

 private void saveView(View view) {
  Bitmap b = Bitmap.createBitmap(view.getWidth(), view.getHeight(),
    Bitmap.Config.ARGB_8888);

  Canvas c = new Canvas(b);

  view.draw(c);

  FileOutputStream fos = null;
  try {

   fos = new FileOutputStream("/mnt/sdcard/"+ System.currentTimeMillis() + ".png");

   if (fos != null) {
    b.compress(Bitmap.CompressFormat.PNG, 100, fos);
    fos.close();
    Toast.makeText(Save.this, fos + "저장 완료", /////////////////////////////////// 이부분 /////////////
      Toast.LENGTH_SHORT).show();
   }

   // setWallpaper(b);

  } catch (Exception e) {
   Log.e("testSaveView", "Exception: " + e.toString()); //////////////////////////// 이부분 ////////////
   Toast.makeText(Save.this, fos + "저장 안됨",
     Toast.LENGTH_SHORT).show();
  }

 }

 class SomeView extends View {
  public SomeView(Context context) {
   super(context);
  }

  public void onDraw(Canvas canvas) {
   canvas.drawARGB(0x80, 0xff, 0, 0);

   Paint paint = new Paint();

   paint.setColor(Color.BLUE);

   paint.setTextSize(48);

   canvas.drawText("...Some view...", 10, canvas.getHeight() / 2,
     paint);
  }

 }
}

앱 개발 도중에.. 위의 예제 소스에서 몇시간 째 해매고 있는데요...

위의 try, catch문 중에서 도데체 왜!? try로 넘어가질 않는건가요... catch로만 빠집니다 ㅠㅠ

이부분 설명 해주실분 없으신가요 ㅠㅠ....... 부탁드려요!!!