Fix:android:Remove some superfluous code
authorrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 12 Mar 2011 20:40:05 +0000 (20:40 +0000)
committerrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 12 Mar 2011 20:40:05 +0000 (20:40 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4332 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/android/src/org/navitproject/navit/Navit.java

index c5d4cb1..415f2a9 100644 (file)
@@ -410,55 +410,29 @@ public class Navit extends Activity implements Handler.Callback
                        Log.e("Navit", "Failed to extract language resource " + langc);\r
                }\r
 \r
-               my_display_density = "mdpi";\r
-               // ldpi display (120 dpi)\r
                if (Navit.metrics.densityDpi <= 120)\r
                {\r
                        my_display_density = "ldpi";\r
-                       if (!extractRes("navitldpi", NAVIT_DATA_DIR + "/share/navit.xml"))\r
-                       {\r
-                               Log.e("Navit", "Failed to extract navit.xml for ldpi device(s)");\r
-                       }\r
                }\r
-               // mdpi display (120 dpi)\r
-               else if ((Navit.metrics.densityDpi > 120) && (Navit.metrics.densityDpi <= 160))\r
+               else if (Navit.metrics.densityDpi <= 160)\r
                {\r
                        my_display_density = "mdpi";\r
-                       if (!extractRes("navitmdpi", NAVIT_DATA_DIR + "/share/navit.xml"))\r
-                       {\r
-                               Log.e("Navit", "Failed to extract navit.xml for mdpi device(s)");\r
-                       }\r
                }\r
-               // hdpi display (240 dpi)\r
-               else if ((Navit.metrics.densityDpi > 160) && (Navit.metrics.densityDpi < 320))\r
-               //else if (Navit.metrics.densityDpi == 240)\r
+               else if (Navit.metrics.densityDpi < 320)\r
                {\r
                        my_display_density = "hdpi";\r
-                       if (!extractRes("navithdpi", NAVIT_DATA_DIR + "/share/navit.xml"))\r
-                       {\r
-                               Log.e("Navit", "Failed to extract navit.xml for hdpi device(s)");\r
-                       }\r
                }\r
-               // xhdpi display (320 dpi)\r
-               else if (Navit.metrics.densityDpi >= 320)\r
+               else\r
                {\r
                        Log.e("Navit", "found xhdpi device, this is not fully supported!!");\r
                        Log.e("Navit", "using hdpi values");\r
                        my_display_density = "hdpi";\r
-                       if (!extractRes("navithdpi", NAVIT_DATA_DIR + "/share/navit.xml"))\r
-                       {\r
-                               Log.e("Navit", "Failed to extract navit.xml for xhdpi device(s)");\r
-                       }\r
                }\r
-               else\r
+\r
+               if (!extractRes("navit" + my_display_density, NAVIT_DATA_DIR + "/share/navit.xml"))\r
                {\r
-                       /* default, meaning we just dont know what display this is */\r
-                       if (!extractRes("navit", NAVIT_DATA_DIR + "/share/navit.xml"))\r
-                       {\r
-                               Log.e("Navit", "Failed to extract navit.xml (default version)");\r
-                       }\r
+                       Log.e("Navit", "Failed to extract navit.xml for " + my_display_density);\r
                }\r
-               // Debug.startMethodTracing("calc");\r
 \r
                // --> dont use!! NavitMain(this, langu, android.os.Build.VERSION.SDK_INT);\r
                Log.e("Navit", "android.os.Build.VERSION.SDK_INT="\r