Use static initializer instead of private static method

This commit is contained in:
fkloft 2013-11-05 00:46:15 +01:00
parent f421302776
commit d7cee2eb22

View File

@ -59,10 +59,8 @@ public class IntentListView extends ListView {
private static final HashSet<CopyHandler> KNOWN_COPY_HANDLERS = new HashSet<CopyHandler>();
private static void setupKnownCopyHandlers() {
if (!KNOWN_COPY_HANDLERS.isEmpty()) {
return;
}
static {
if (KNOWN_COPY_HANDLERS.isEmpty()) {
KNOWN_COPY_HANDLERS.add(new CopyHandler(
"com.google.android.apps.docs",
@ -72,10 +70,11 @@ public class IntentListView extends ListView {
"com.aokp.romcontrol",
"com.aokp.romcontrol.ShareToClipboard"));
}
}
private final HashMap<ComponentName, Intent> mActivities = new HashMap<ComponentName, Intent>();
private IntentAdapter mAdapter;
private PackageManager mPackageManager;
private final HashMap<ComponentName, Intent> mActivities = new HashMap<ComponentName, Intent>();
public IntentListView(Context context) {
super(context);
@ -93,8 +92,6 @@ public class IntentListView extends ListView {
}
private void init() {
setupKnownCopyHandlers();
mPackageManager = getContext().getPackageManager();
mAdapter = new IntentAdapter();
setAdapter(mAdapter);