Change ClipboardManager to no longer be a singleton

This avoids holding onto a Context instance in a static field.
This commit is contained in:
cketti 2017-02-06 03:24:57 +01:00
parent da2012be1d
commit f82beb4287

View file

@ -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);
}