÷ȶ Դϴ
ġ ذϰ غôµ ȵ˴ϴ. ¥ ü ФФ
-------------------------------------
ȭ ĸ ư ߽ϴ.
container.buildDrawingCache();
container.setDrawingCacheEnabled(true);
Bitmap captureView = container.getDrawingCache();
FileOutputStream fos;
Intent it3=getIntent();
String str_name=it3.getStringExtra("it3_name");
File fileRoute = null;
fileRoute = Environment.getExternalStorageDirectory();
try {
File path = new File(fileRoute+"/play");
if(!path.isDirectory()){
path.mkdirs();
}
fos = new FileOutputStream(fileRoute+"/play/-"+str_name+"-.jpeg");
captureView.compress(Bitmap.CompressFormat.JPEG, 100, fos); //843°
}catch (FileNotFoundException e) {
e.printStackTrace();
}
Toast.makeText(getApplicationContext(), "/sdcard/play Ǿϴ.", Toast.LENGTH_LONG).show();
ҽ 2.2 ο (ζ) ߵ˴ϴ.
(Ƽӽ Ex) Ʈ ؔfµ ĸĹư ˴ϴ.
αĹ ôµ 843°
captureView.compress(Bitmap.CompressFormat.JPEG, 100, fos); //843°
κԴϴ.
OS ζ״° ˾Ҵµ ⼭ ζ °žƴѰ?
ذؾ ϳ?
06-16 16:48:48.390: E/AndroidRuntime(25620): FATAL EXCEPTION: main
06-16 16:48:48.390: E/AndroidRuntime(25620): java.lang.NullPointerException
06-16 16:48:48.390: E/AndroidRuntime(25620): at com.example.faceon.ResultActivity.onClick(ResultActivity.java:843)
06-16 16:48:48.390: E/AndroidRuntime(25620): at android.view.View.performClick(View.java:3524)
06-16 16:48:48.390: E/AndroidRuntime(25620): at android.view.View$PerformClick.run(View.java:14226)
06-16 16:48:48.390: E/AndroidRuntime(25620): at android.os.Handler.handleCallback(Handler.java:605)
06-16 16:48:48.390: E/AndroidRuntime(25620): at android.os.Handler.dispatchMessage(Handler.java:92)
06-16 16:48:48.390: E/AndroidRuntime(25620): at android.os.Looper.loop(Looper.java:137)
06-16 16:48:48.390: E/AndroidRuntime(25620): at android.app.ActivityThread.main(ActivityThread.java:4526)
06-16 16:48:48.390: E/AndroidRuntime(25620): at java.lang.reflect.Method.invokeNative(Native Method)
06-16 16:48:48.390: E/AndroidRuntime(25620): at java.lang.reflect.Method.invoke(Method.java:511)
06-16 16:48:48.390: E/AndroidRuntime(25620): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
06-16 16:48:48.390: E/AndroidRuntime(25620): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
06-16 16:48:48.390: E/AndroidRuntime(25620): at dalvik.system.NativeStart.main(Native Method) | |
|
843 κп null ٴ Ű
fos null ȯ ʴ Ȯؾ κԴϴ.
Ʈ ΰ ٽϴ.
ٸ Ʈ