OSDN Git Service

update to version 1.1.0. (r2363) android-x86-1.6
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 3 Nov 2009 09:49:22 +0000 (17:49 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 3 Nov 2009 09:49:22 +0000 (17:49 +0800)
14 files changed:
AndroidManifest.xml
readme.txt
res/values-de/strings.xml
res/values-es/strings.xml
res/values-nl/strings.xml
res/values-zh-rCN/strings.xml
res/values/strings_not_for_translation.xml
res/xml/mimetypes.xml
src/org/openintents/distribution/AboutDialog.java
src/org/openintents/distribution/GetFromMarketDialog.java
src/org/openintents/distribution/RD.java
src/org/openintents/distribution/UpdateMenu.java
src/org/openintents/filemanager/DirectoryScanner.java
src/org/openintents/filemanager/FileManagerActivity.java

index 8c0d172..8eda711 100644 (file)
  -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="org.openintents.filemanager"
-       android:versionName="1.0.1-rc1"
-       android:versionCode="2">
-       <!-- History: 1.0.0 [1]: 2008-12-10
-       1.0.1 [2]: 2009-01-16 -->
+       android:versionName="1.1.0"
+       android:versionCode="5">
+       <!-- History:
+       [5] 1.1.0:     2009-10-30
+       [4] 1.1.0-rc1: 2009-10-24
+       [3] 1.0.2:     2009-10-15
+       [2] 1.0.1:     2009-01-16
+       [1] 1.0.0:     2008-12-10
+       -->
+
+
+        <uses-sdk android:minSdkVersion="2"
+            android:targetSdkVersion="4"
+
+     />
+
+<supports-screens android:smallScreens="true"
+                  android:normalScreens="true"
+                  android:largeScreens="true"
+/>
+
+           <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <application android:icon="@drawable/ic_launcher_folder" android:label="@string/app_name">
+
+        <!-- aTrackDog metadata -->
+        <meta-data android:name="com.a0soft.gphone.aTrackDog.testVersion"
+           android:value="4" />
+
                <meta-data android:name="org.openintents.metadata.COMMENTS"
                        android:value="@string/about_comments" />
         <meta-data android:name="org.openintents.metadata.COPYRIGHT"
         </activity>  -->
     <provider android:name=".FileManagerProvider" android:authorities="org.openintents.filemanager"></provider>
 </application>
-</manifest> 
\ No newline at end of file
+</manifest>
index bbf37d9..05158b2 100644 (file)
@@ -22,16 +22,21 @@ To obtain the current release, visit
   http://www.openintents.org
 
 ---------------------------------------------------------
-release: 1.0.1
-date: 2008-12-??
-- Added support for following extensions:
+release: 1.1.0
+date: 2009-10-30
+- display file size.
+- show thumbnails for images.
+- copy files.
+- handle GET_CONTENT action.
+- added support for all WebKit extensions.
+- added support for following extensions:
   .amr, .3gp
-- Added support for upper case or mixed case letter
+- added support for upper case or mixed case letter
   extensions (like .png and .PNG)
-- Fix for send files via MMS.
+- fix for send files via MMS.
 - support for OI About.
 - encode file URIs properly
-- translations: French, German
+- translations: Chinese, French, German, Japanese, Spanish
 
 ---------------------------------------------------------
 release: 1.0.0
index 9dcca92..f357c95 100644 (file)
@@ -21,7 +21,8 @@
        
        <!-- Automatically filled in by Launchpad: -->
        <string name="about_translators">Launchpad Contributions:
-  Peli https://launchpad.net/~peli0101</string>
+  Peli https://launchpad.net/~peli0101
+  marco.jahn https://launchpad.net/~accounts+launchpad-net</string>
        
     <string name="about_comments">OI Dateimanager ist ein offener Dateimanager, der nahtlos mit anderen Anwendungen zusammenarbeitet.</string>  
        <string name="about_website_label">OI Dateimanager auf OpenIntents</string> 
@@ -37,7 +38,7 @@
     <string name="menu_send">Senden</string>
     <string name="menu_open">Öffnen</string>
     <string name="menu_move">Verschieben</string>
-    <string name="menu_copy">Copy</string>
+    <string name="menu_copy">Kopie</string>
     
     <string name="create_new_folder">Neuen Ordner erstellen</string>
     <string name="folder_name">Name des Ordners</string>
     <string name="folder_renamed">Ordner umbenannt.</string>
     <string name="file_moved">Datei verschoben.</string>
     <string name="folder_moved">Ordner verschoben.</string>
-    <string name="file_copied">File copied.</string>
+    <string name="file_copied">Datei kopiert.</string>
     <string name="move_title">Ordner zum Verschieben auswählen</string>
     <string name="move_button">Hierher verschieben</string>
-    <string name="copy_title">Select folder to copy to</string>
-    <string name="copy_button">Copy here</string>
-    
-    <string name="copied_file_name">Copy of %s</string>
-    <string name="copied_file_name_2">Copy %d of %s</string>
+    <string name="copy_title">Wählen Sie Zielverzeichnis für den Kopiervorgang</string>
+    <string name="copy_button">Hierher kopieren</string>
+
+    <string name="copied_file_name">Kopie von %s</string>
+    <string name="copied_file_name_2">%d von %s kopiert</string>
 
     <string name="error_creating_new_folder">Neuer Ordner konnte nicht erstellt werden.</string>
     <string name="error_deleting_file">Datei konnte nicht gelöscht werden.</string>
@@ -66,7 +67,7 @@
     <string name="error_renaming_folder">Ordner konnte nicht umbenannt werden.</string>
     <string name="error_moving_file">Datei konnte nicht verschoben werden.</string>
     <string name="error_moving_folder">Ordner konnte nicht verschoben werden.</string>
-    <string name="error_copying_file">Could not copy file.</string>
+    <string name="error_copying_file">Datei kann nicht kopiert werden.</string>
     <string name="error_file_does_not_exists">Datei existiert nicht.</string>
     
     <string name="send_not_available">Keine Anwendung zum Senden vorhanden.</string>
index 7494b20..d6fd849 100644 (file)
 
        <!-- Automatically filled in by Launchpad: -->
        <string name="about_translators">Launchpad Contributions:
+  DiegoJ https://launchpad.net/~diegojromerolopez
   miwie https://launchpad.net/~mw-miwie</string>
 
-    <string name="about_comments">OI File Manager is an open file manager that seamlessly cooperates with other applications.</string>
+    <string name="about_comments">OI File Manager es un gestor abierto de archivos que cooperar fluidamente con otras aplicaciones.</string>
        <string name="about_website_label">OI File Manager en OpenIntents</string>
 
        <!-- ***************************
@@ -37,7 +38,7 @@
     <string name="menu_send">Enviar</string>
     <string name="menu_open">Abrir</string>
     <string name="menu_move">Mover</string>
-    <string name="menu_copy">Copy</string>
+    <string name="menu_copy">Copiar</string>
 
     <string name="create_new_folder">Crear nueva carpeta</string>
     <string name="folder_name">Nombre de carpeta</string>
     <string name="folder_renamed">Carpeta cambiado de nombre.</string>
     <string name="file_moved">Fichero movido.</string>
     <string name="folder_moved">Carpeta movido.</string>
-    <string name="file_copied">File copied.</string>
+    <string name="file_copied">Archivo copiado.</string>
     <string name="move_title">Seleccionar carpeta de destino</string>
     <string name="move_button">Mover acá</string>
-    <string name="copy_title">Select folder to copy to</string>
-    <string name="copy_button">Copy here</string>
+    <string name="copy_title">Seleccione carpeta a copiar a</string>
+    <string name="copy_button">Copiar aquí</string>
 
-    <string name="copied_file_name">Copy of %s</string>
-    <string name="copied_file_name_2">Copy %d of %s</string>
+    <string name="copied_file_name">Copia de %s</string>
+    <string name="copied_file_name_2">Copia %d de %s</string>
 
     <string name="error_creating_new_folder">No se puede crear la carpeta nueva.</string>
     <string name="error_deleting_file">No se puede borrar el fichero.</string>
@@ -66,7 +67,7 @@
     <string name="error_renaming_folder">No se puede cambiar de nombre de la carpeta.</string>
     <string name="error_moving_file">No se puede mover el fichero.</string>
     <string name="error_moving_folder">No se puede mover la carpeta.</string>
-    <string name="error_copying_file">Could not copy file.</string>
+    <string name="error_copying_file">No se pudo copiar el archivo.</string>
     <string name="error_file_does_not_exists">El archivo no existe.</string>
 
     <string name="send_not_available">Aplicación no disponible para enviar.</string>
        <string name="eula_refuse">Cancelar</string>
 
        <!-- Update -->
-       <string name="update_box_text">Please check manually for updates or install OI Update
-for automatic notifications.
-Current version: %s
-       </string>
+       <string name="update_box_text">Por favor, compruebe manualmente las actualizaciones o instale OI Update para notificaciones automáticas. Versión actual: %s</string>
        <string name="update_check_now">Comprobar ahora.</string>
        <string name="update_get_updater">Obtenga el Actualizador de OI</string>
        <string name="update_error">Descarga aplicación no disponible.</string>
@@ -94,7 +92,7 @@ Current version: %s
 
     <!-- About -->
     <string name="about">Sobre</string>
-       <string name="aboutapp_not_available">Version %s\n\nNo compatible extension available to display full info (contact, credits, license).</string>
+       <string name="aboutapp_not_available">La versión %s\nNo es compatible con el complemento disponible para mostrar información completa (contacto, créditos, licencia).</string>
     <string name="aboutapp_get">Obtenga Acerca de OI</string>
 
 
index 86d9174..800a8ba 100644 (file)
@@ -21,6 +21,7 @@
 
        <!-- Automatically filled in by Launchpad: -->
        <string name="about_translators">Launchpad Contributions:
+  Simon de Vlieger https://launchpad.net/~ikanobori
   pjv https://launchpad.net/~pjv</string>
 
     <string name="about_comments">OI File Manager is an open file manager that seamlessly cooperates with other applications.</string>
@@ -37,7 +38,7 @@
     <string name="menu_send">Verzenden</string>
     <string name="menu_open">Openen</string>
     <string name="menu_move">Verplaatsen</string>
-    <string name="menu_copy">Copy</string>
+    <string name="menu_copy">Kopieer</string>
 
     <string name="create_new_folder">Nieuwe map aanmaken</string>
     <string name="folder_name">Naam van de map</string>
     <string name="folder_renamed">Map hernoemd.</string>
     <string name="file_moved">Bestand verplaatst.</string>
     <string name="folder_moved">Map verplaatst.</string>
-    <string name="file_copied">File copied.</string>
-    <string name="move_title">Select folder to move to</string>
-    <string name="move_button">Move here</string>
-    <string name="copy_title">Select folder to copy to</string>
-    <string name="copy_button">Copy here</string>
+    <string name="file_copied">Bestand gekopieerd.</string>
+    <string name="move_title">Kies map om naartoe te verplaatsen</string>
+    <string name="move_button">Hierheen verplaatsen</string>
+    <string name="copy_title">Kies map om naartoe te kopiëren</string>
+    <string name="copy_button">Kopieer hier</string>
 
-    <string name="copied_file_name">Copy of %s</string>
-    <string name="copied_file_name_2">Copy %d of %s</string>
+    <string name="copied_file_name">Kopie van %s</string>
+    <string name="copied_file_name_2">Kopie %d van %s</string>
 
     <string name="error_creating_new_folder">Could not create new folder.</string>
     <string name="error_deleting_file">Could not delete file.</string>
index d5ea26d..328fb3b 100644 (file)
        <string name="about_translators">Launchpad Contributions:
   Swandle https://launchpad.net/~swandle</string>
        
-    <string name="about_comments">OI文件管理是一个开源的文件管理软件,它可以与其它应用程序进行无缝整合。</string>  
-       <string name="about_website_label">OpenIntents的文件管理</string> 
+    <string name="about_comments">OI文件管理器是一个开源的文件管理软件,它可以与其它应用程序进行无缝整合。</string>
+       <string name="about_website_label">开放组件的OI文件管理器</string>
        
        <!-- ***************************
             Applicatio-specific strings
             *************************** -->
-    <string name="app_name">OI文件管理</string>
+    <string name="app_name">OI文件管理</string>
     
     <string name="menu_new_folder">新建文件夹</string>
     <string name="menu_delete">删除</string>
     <string name="folder_name">文件夹名</string>
     <string name="file_name">文件夹名</string>
     <string name="this_folder_is_empty">该文件夹为空</string>
-    <string name="really_delete">你真要删除 %s 吗?</string>
+    <string name="really_delete">确实要删除 %s 吗?</string>
     <string name="file_deleted">文件已删除</string>
     <string name="folder_deleted">文件夹已删除</string>
-    <string name="file_renamed">文件重命名</string>
+    <string name="file_renamed">文件重命名</string>
     <string name="folder_renamed">文件夹已重命名</string>
     <string name="file_moved">文件已移动</string>
     <string name="folder_moved">文件夹已移动</string>
index 82b30fa..335344f 100644 (file)
             *************************** -->
        <!-- Update -->
        <string name="update_app_url">market://search?q=pname:org.openintents.filemanager</string>
+       <string name="update_app_developer_url">http://www.openintents.org/en/node/159</string><!-- 159 = OI File Manager -->
        <string name="update_checker_url">market://search?q=pname:org.openintents.updatechecker</string>
+       <string name="update_checker_developer_url">http://www.openintents.org/en/node/203</string><!-- 203 = OI Update -->
        
        <!-- About -->
     <string name="aboutapp_market_uri">market://search?q=pname:org.openintents.about</string>
+    <string name="aboutapp_developer_uri">http://www.openintents.org/en/node/202</string><!-- 202 = OI About -->
     
        <!-- ***************************
             Preferences
index 6a757fb..6ac0ac7 100644 (file)
@@ -22,7 +22,7 @@
        <type extension=".jpeg" mimetype="image/jpeg" />
        <type extension=".bmp" mimetype="image/bmp" />
            
-       <!-- Autio types -->
+       <!-- Audio types -->
        <type extension=".mp3" mimetype="audio/mp3" />
        <type extension=".wav" mimetype="audio/wav" />
        <type extension=".ogg" mimetype="audio/x-ogg" />
@@ -53,4 +53,4 @@
        <!-- Android specific -->
        <type extension=".apk" mimetype="application/vnd.android.package-archive" />
        
-</MimeTypes>
+</MimeTypes>
\ No newline at end of file
index 52d707f..d1490db 100644 (file)
@@ -27,7 +27,7 @@ import android.content.Intent;
 /**
  * About dialog
  *
- * @version 2009-01-16
+ * @version 2009-02-04
  * @author Peli
  *
  */
@@ -38,7 +38,8 @@ public class AboutDialog extends GetFromMarketDialog {
                super(context,
                                RD.string.aboutapp_not_available,
                                RD.string.aboutapp_get,
-                               RD.string.aboutapp_market_uri);
+                               RD.string.aboutapp_market_uri,
+                               RD.string.aboutapp_developer_uri);
                
                String version = VersionUtils.getVersionNumber(context);
                String name = VersionUtils.getApplicationName(context);
index 494b6e0..78356b9 100644 (file)
@@ -10,16 +10,23 @@ import android.net.Uri;
 import android.util.Log;
 import android.widget.Toast;
 
+/**
+ * @version 2009-02-04
+ * @author Peli
+ *
+ */
 public class GetFromMarketDialog extends AlertDialog implements OnClickListener {
        private static final String TAG = "StartSaveActivity";
 
     Context mContext;
     int mMarketUri;
+    int mDeveloperUri;
     
-    public GetFromMarketDialog(Context context, int message, int buttontext, int market_uri) {
+    public GetFromMarketDialog(Context context, int message, int buttontext, int market_uri, int developer_uri) {
         super(context);
         mContext = context;
         mMarketUri = market_uri;
+        mDeveloperUri = developer_uri;
 
         //setTitle(context.getText(R.string.menu_edit_tags));
         setMessage(mContext.getText(message));
@@ -33,7 +40,11 @@ public class GetFromMarketDialog extends AlertDialog implements OnClickListener
                
                        Intent intent = new Intent(Intent.ACTION_VIEW);
                        intent.setData(uri);
-                       GetFromMarketDialog.startSaveActivity(mContext, intent);
+
+                       uri= Uri.parse(mContext.getString(mDeveloperUri));
+                       Intent intent2 = new Intent(Intent.ACTION_VIEW);
+                       intent2.setData(uri);
+                       startSaveActivity(mContext, intent, intent2);
        }
                
        }
@@ -44,15 +55,21 @@ public class GetFromMarketDialog extends AlertDialog implements OnClickListener
         * 
         * @param context
         * @param intent
+        * @param intent2 Alternative intent to call, if the first is not reachable
         */
-       public static void startSaveActivity(Context context, Intent intent) {
+       public static void startSaveActivity(Context context, Intent intent, Intent intent2) {
                try {
                        context.startActivity(intent);
                } catch (ActivityNotFoundException e) {
-                       Toast.makeText(context,
-                                       RD.string.update_error,
-                                       Toast.LENGTH_SHORT).show();
                        Log.e(TAG, "Error starting activity.", e);
+                       try {
+                               context.startActivity(intent2);
+                       } catch (ActivityNotFoundException e2) {
+                               Toast.makeText(context,
+                                               RD.string.update_error,
+                                               Toast.LENGTH_SHORT).show();
+                               Log.e(TAG, "Error starting second activity.", e2);
+                       }
                }
        }
-}
+}
\ No newline at end of file
index 0fb4891..ee9a44c 100644 (file)
@@ -32,8 +32,10 @@ public class RD {
                public static final int update_box_text = R.string.update_box_text;
                public static final int update_check_now = R.string.update_check_now;
                public static final int update_app_url = R.string.update_app_url;
+               public static final int update_app_developer_url = R.string.update_app_developer_url;
                public static final int update_get_updater = R.string.update_get_updater;
                public static final int update_checker_url = R.string.update_checker_url;
+               public static final int update_checker_developer_url = R.string.update_checker_developer_url;
                public static final int update_error = R.string.update_error;
 
                ///////////////////////////////////////
@@ -41,6 +43,8 @@ public class RD {
                public static final int aboutapp_not_available = R.string.aboutapp_not_available;
                public static final int aboutapp_get = R.string.aboutapp_get;
                public static final int aboutapp_market_uri = R.string.aboutapp_market_uri;
+               public static final int aboutapp_developer_uri = R.string.aboutapp_developer_uri;
+
        }
 
        public class raw {
index dd9ecb0..2dc86a1 100644 (file)
@@ -16,8 +16,6 @@
 
 package org.openintents.distribution;
 
-// Version Nov 12, 2008
-
 import android.app.AlertDialog.Builder;
 import android.content.ActivityNotFoundException;
 import android.content.Context;
@@ -32,11 +30,26 @@ import android.view.Menu;
 import android.view.MenuItem;
 import android.widget.Toast;
 
+/**
+ * @version 2009-10-23: support Market and aTrackDog
+ * @version 2009-02-04
+ * @author Peli
+ *
+ */
 public class UpdateMenu {
        
        private static final String TAG = "UpdateMenu";
        
-       public static final String UPDATE_CHECKER = "org.openintents.updatechecker";
+       /**
+        * If any of the following applications is installed,
+        * there is no need for a manual "Update" menu entry.
+        */
+       public static final String[] UPDATE_CHECKER = new String[]
+           {
+                       "org.openintents.updatechecker", // OI Update
+                       "com.android.vending", // Google's Android Market
+                       "com.a0soft.gphone.aTrackDog" // aTrackDog
+           };
 
        /**
         * Adds a menu item for update only if update checker is not installed.
@@ -52,19 +65,26 @@ public class UpdateMenu {
        public static MenuItem addUpdateMenu(Context context, Menu menu, int groupId,
                        int itemId, int order, int titleRes) {
                PackageInfo pi = null;
-               try {
-                       pi = context.getPackageManager().getPackageInfo(
-                                       UPDATE_CHECKER, 0);
-               } catch (NameNotFoundException e) {
-                       // ignore
-               }
-               if (pi == null) {
-                       return menu.add(groupId, itemId, order, titleRes).setIcon(
-                                       android.R.drawable.ic_menu_info_details).setShortcut('9',
-                                       'u');
-               } else {
-                       return null;
+
+               // Test for existence of all known update checker applications.
+               for (int i = 0; i < UPDATE_CHECKER.length; i++) {
+                       try {
+                               pi = context.getPackageManager().getPackageInfo(
+                                               UPDATE_CHECKER[i], 0);
+                       } catch (NameNotFoundException e) {
+                               // ignore
+                       }
+                       if (pi != null) {
+                               // At least one kind of update checker exists,
+                               // so there is no need to add a menu item.
+                               return null;
+                       }
                }
+
+               // If we reach this point, we add a menu item for manual update.
+               return menu.add(groupId, itemId, order, titleRes).setIcon(
+                               android.R.drawable.ic_menu_info_details).setShortcut('9',
+                               'u');
        }
        
 
@@ -81,40 +101,25 @@ public class UpdateMenu {
                        e.printStackTrace();
                }
                final Intent intent  = new Intent(Intent.ACTION_VIEW);
+               final Intent intent2  = new Intent(Intent.ACTION_VIEW);
                new Builder(context).setMessage(context.getString(RD.string.update_box_text, version))
                .setPositiveButton(RD.string.update_check_now, new OnClickListener(){
 
                        public void onClick(DialogInterface arg0, int arg1) {
                                intent.setData(Uri.parse(context.getString(RD.string.update_app_url)));
-                               startSaveActivity(context, intent);
+                               intent2.setData(Uri.parse(context.getString(RD.string.update_app_developer_url)));
+                               GetFromMarketDialog.startSaveActivity(context, intent, intent2);
                        }
                        
                }).setNegativeButton(RD.string.update_get_updater, new OnClickListener(){
 
                        public void onClick(DialogInterface dialog, int which) {
                                intent.setData(Uri.parse(context.getString(RD.string.update_checker_url)));
-                               startSaveActivity(context, intent);
+                               intent2.setData(Uri.parse(context.getString(RD.string.update_checker_developer_url)));
+                               GetFromMarketDialog.startSaveActivity(context, intent, intent2);
                        }
                        
                }).show();              
        }
-       
-       /**
-        * Start an activity but prompt a toast if activity is not found
-        * (instead of crashing).
-        * 
-        * @param context
-        * @param intent
-        */
-       private static void startSaveActivity(Context context, Intent intent) {
-               try {
-                       context.startActivity(intent);
-               } catch (ActivityNotFoundException e) {
-                       Toast.makeText(context,
-                                       RD.string.update_error,
-                                       Toast.LENGTH_SHORT).show();
-                       Log.e(TAG, "Error starting activity.", e);
-               }
-       }
 
 }
index 684a2ac..c269a90 100644 (file)
@@ -6,6 +6,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import org.openintents.filemanager.util.FileUtils;
 import org.openintents.filemanager.util.MimeTypes;
 
 import android.content.Context;
@@ -13,6 +14,7 @@ import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.graphics.drawable.Drawable;
+import android.net.Uri;
 import android.os.Handler;
 import android.os.Message;
 import android.os.SystemClock;
@@ -43,12 +45,13 @@ public class DirectoryScanner extends Thread {
     
 
 
-       DirectoryScanner(File directory, Context context, Handler handler, MimeTypes mimeTypes) {
+       DirectoryScanner(File directory, Context context, Handler handler, MimeTypes mimeTypes, String sdCardPath) {
                super("Directory Scanner");
                currentDirectory = directory;
                this.context = context;
                this.handler = handler;
                this.mMimeTypes = mimeTypes;
+               this.mSdCardPath = sdCardPath;
        }
        
        private void clearData() {
@@ -129,7 +132,7 @@ public class DirectoryScanner extends Thread {
 
                                String mimetype = mMimeTypes.getMimeType(fileName);
 
-                               currentIcon = getDrawableForMimetype(mimetype);
+                               currentIcon = getDrawableForMimetype(currentFile, mimetype);
                                if (currentIcon == null) {
                                        currentIcon = genericFileIcon;
                                }
@@ -204,17 +207,36 @@ public class DirectoryScanner extends Thread {
      * @param mimetype
      * @return
      */
-    Drawable getDrawableForMimetype(String mimetype) {
+    Drawable getDrawableForMimetype(File file, String mimetype) {
+     if (mimetype == null) {
+        return null;
+     }
+
         PackageManager pm = context.getPackageManager();
         
+        Uri data = FileUtils.getUri(file);
+
         Intent intent = new Intent(Intent.ACTION_VIEW);
-        intent.setType(mimetype);
+        //intent.setType(mimetype);
         
+        // Let's probe the intent exactly in the same way as the VIEW action
+        // is performed in FileManagerActivity.openFile(..)
+     intent.setDataAndType(data, mimetype);
+
         final List<ResolveInfo> lri = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
         
         if (lri != null && lri.size() > 0) {
+                //Log.i(TAG, "lri.size()" + lri.size());
+
                 // return first element
-                final ResolveInfo ri = lri.get(0);
+                int index = 0;
+
+                // Actually first element should be "best match",
+                // but it seems that more recently installed applications
+                // could be even better match.
+                index = lri.size()-1;
+
+                final ResolveInfo ri = lri.get(index);
                 return ri.loadIcon(pm);
         }
         
index 5edb499..4346591 100644 (file)
@@ -626,7 +626,7 @@ public class FileManagerActivity extends ListActivity {
           mProgressBar.setVisibility(View.GONE);
           setListAdapter(null); 
           
-                 mDirectoryScanner = new DirectoryScanner(currentDirectory, this, currentHandler, mMimeTypes);
+                 mDirectoryScanner = new DirectoryScanner(currentDirectory, this, currentHandler, mMimeTypes, mSdCardPath);
                  mDirectoryScanner.start();
                  
                  
@@ -906,17 +906,23 @@ public class FileManagerActivity extends ListActivity {
                menu.add(0, MENU_RENAME, 0, R.string.menu_rename);
                menu.add(0, MENU_DELETE, 0, R.string.menu_delete);
 
-        Uri data = Uri.fromFile(file);
-        Intent intent = new Intent(null, data);
-        String type = mMimeTypes.getMimeType(file.getName());
+               //if (!file.isDirectory()) {
+               Uri data = Uri.fromFile(file);
+               Intent intent = new Intent(null, data);
+               String type = mMimeTypes.getMimeType(file.getName());
 
-        intent.setDataAndType(data, type);
+               intent.setDataAndType(data, type);
+               //intent.addCategory(Intent.CATEGORY_SELECTED_ALTERNATIVE);
 
-//        Log.v(TAG, "Data=" + data);
-//        Log.v(TAG, "Type=" + type);
-               
-               menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0,
-                               new ComponentName(this, FileManagerActivity.class), null, intent, 0, null);
+               Log.v(TAG, "Data=" + data);
+               Log.v(TAG, "Type=" + type);
+
+               if (type != null) {
+                       // Add additional options for the MIME type of the selected file.
+                               menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0,
+                                               new ComponentName(this, FileManagerActivity.class), null, intent, 0, null);
+               }
+               //}
        }
 
        @Override