Change ClipboardManager to no longer be a singleton
This avoids holding onto a Context instance in a static field.
This commit is contained in:
parent
da2012be1d
commit
f82beb4287
1 changed files with 1 additions and 9 deletions
|
@ -8,17 +8,9 @@ import android.content.Context;
|
|||
* Access the system clipboard using the new {@link ClipboardManager} introduced with API 11
|
||||
*/
|
||||
public class ClipboardManager {
|
||||
|
||||
private static ClipboardManager sInstance = null;
|
||||
|
||||
public static ClipboardManager getInstance(Context context) {
|
||||
Context appContext = context.getApplicationContext();
|
||||
|
||||
if (sInstance == null) {
|
||||
sInstance = new ClipboardManager(appContext);
|
||||
}
|
||||
|
||||
return sInstance;
|
||||
return new ClipboardManager(appContext);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue