+ List<KeyAction> actions = new LinkedList<KeyAction>();
+
+ // TODO del, save...
+ actions.add(new KeyAction(Mode.CONTACT_LIST, KeyType.Enter,
+ Trans.StringId.KEY_ACTION_VIEW_CARD) {
+ @Override
+ public Object getObject() {
+ File file = files.get(getSelectedIndex());
+ Format format = Format.Abook;
+ String ext = file.getName();
+ if (ext.contains(".")) {
+ String tab[] = ext.split("\\.");
+ if (tab.length > 1
+ && tab[tab.length - 1].equalsIgnoreCase("vcf")) {
+ format = Format.VCard21;
+ }
+ }
+ try {
+ return new Card(file, format);
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ return null;
+ }
+ }
+ });
+
+ return actions;