1 |
package com.caddi.android.caddipictureupload; |
2 |
|
3 |
import android.graphics.Bitmap; |
4 |
|
5 |
/** |
6 |
* Created by torben on 7/26/15. |
7 |
*/ |
8 |
public class PictureSingleton { |
9 |
|
10 |
private static PictureSingleton mInstance = null; |
11 |
|
12 |
/** |
13 |
* Billeder er for store til at blive sendt rundt i Intents, så derfor denne shared instance |
14 |
*/ |
15 |
private Bitmap picture; |
16 |
|
17 |
private PictureSingleton() { |
18 |
} |
19 |
|
20 |
public static PictureSingleton getInstance() { |
21 |
synchronized (PictureSingleton.class) { |
22 |
if (mInstance == null) { |
23 |
mInstance = new PictureSingleton(); |
24 |
} |
25 |
return mInstance; |
26 |
} |
27 |
} |
28 |
|
29 |
public Bitmap getPicture() { |
30 |
return picture; |
31 |
} |
32 |
|
33 |
public void setPicture(Bitmap bitmap) { |
34 |
this.picture = bitmap; |
35 |
} |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
} |