| Autors | SHA1 | Ziņojums | Datums |
|---|---|---|---|
|
|
81f5835a44 | 6 gadi atpakaļ |
@@ -123,6 +123,7 @@ public class CameraService extends Service implements Handler.Callback, Camera.C |
||
| 123 | 123 |
public void startCapture() {
|
| 124 | 124 |
stopCapture(); |
| 125 | 125 |
mainHandler.sendEmptyMessage(MSG_CHECK_STORAGE); |
| 126 |
+ camera.capture(); |
|
| 126 | 127 |
} |
| 127 | 128 |
|
| 128 | 129 |
public void stopCapture() {
|
@@ -252,6 +253,10 @@ public class CameraService extends Service implements Handler.Callback, Camera.C |
||
| 252 | 253 |
@Override |
| 253 | 254 |
public void onObjectAdded(int handle) {
|
| 254 | 255 |
LogHelper.d("czy", "CameraService onObjectAdded: " + handle);
|
| 256 |
+ if (camera == null) {
|
|
| 257 |
+ return; |
|
| 258 |
+ } |
|
| 259 |
+ camera.retrievePicture(handle); |
|
| 255 | 260 |
} |
| 256 | 261 |
|
| 257 | 262 |
@Override |
@@ -336,7 +341,8 @@ public class CameraService extends Service implements Handler.Callback, Camera.C |
||
| 336 | 341 |
if(!dir.exists()){
|
| 337 | 342 |
dir.mkdir(); |
| 338 | 343 |
} |
| 339 |
- File file = new File(dir,handle +".jpg"); |
|
| 344 |
+ filename = handle +".jpg"; |
|
| 345 |
+ File file = new File(dir,filename); |
|
| 340 | 346 |
FileOutputStream fos = new FileOutputStream(file); |
| 341 | 347 |
bitmap.compress(Bitmap.CompressFormat.JPEG,100,fos); |
| 342 | 348 |
fos.flush(); |