Use static initializer instead of private static method
This commit is contained in:
parent
f421302776
commit
d7cee2eb22
@ -59,23 +59,22 @@ 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",
|
||||
"com.google.android.apps.docs.app.SendTextToClipboardActivity"));
|
||||
|
||||
KNOWN_COPY_HANDLERS.add(new CopyHandler(
|
||||
"com.aokp.romcontrol",
|
||||
"com.aokp.romcontrol.ShareToClipboard"));
|
||||
}
|
||||
|
||||
KNOWN_COPY_HANDLERS.add(new CopyHandler(
|
||||
"com.google.android.apps.docs",
|
||||
"com.google.android.apps.docs.app.SendTextToClipboardActivity"));
|
||||
|
||||
KNOWN_COPY_HANDLERS.add(new CopyHandler(
|
||||
"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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user