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 final HashSet<CopyHandler> KNOWN_COPY_HANDLERS = new HashSet<CopyHandler>();
|
||||||
|
|
||||||
private static void setupKnownCopyHandlers() {
|
static {
|
||||||
if (!KNOWN_COPY_HANDLERS.isEmpty()) {
|
if (KNOWN_COPY_HANDLERS.isEmpty()) {
|
||||||
return;
|
|
||||||
|
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 IntentAdapter mAdapter;
|
||||||
private PackageManager mPackageManager;
|
private PackageManager mPackageManager;
|
||||||
private final HashMap<ComponentName, Intent> mActivities = new HashMap<ComponentName, Intent>();
|
|
||||||
|
|
||||||
public IntentListView(Context context) {
|
public IntentListView(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@ -93,8 +92,6 @@ public class IntentListView extends ListView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
setupKnownCopyHandlers();
|
|
||||||
|
|
||||||
mPackageManager = getContext().getPackageManager();
|
mPackageManager = getContext().getPackageManager();
|
||||||
mAdapter = new IntentAdapter();
|
mAdapter = new IntentAdapter();
|
||||||
setAdapter(mAdapter);
|
setAdapter(mAdapter);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user