… | |
… | |
216 | public static final int NavitAddressSearch_id_online = 73;
|
216 | public static final int NavitAddressSearch_id_online = 73;
|
217 | public static final int NavitAddressResultList_id = 71;
|
217 | public static final int NavitAddressResultList_id = 71;
|
218 | public static final int NavitAddressSearchCountry_id = 74;
|
218 | public static final int NavitAddressSearchCountry_id = 74;
|
219 | public static final int NavitMapPreview_id = 75;
|
219 | public static final int NavitMapPreview_id = 75;
|
220 | public static final int NavitAddressSearch_id_gmaps = 76;
|
220 | public static final int NavitAddressSearch_id_gmaps = 76;
|
|
|
221 | public static int NavitSearchresultBarIndex = -1;
|
|
|
222 | public static String NavitSearchresultBar_title = "";
|
|
|
223 | public static String NavitSearchresultBar_text = "";
|
221 | public static List<Navit_Address_Result_Struct> NavitAddressResultList_foundItems = new ArrayList<Navit_Address_Result_Struct>();
|
224 | public static List<Navit_Address_Result_Struct> NavitAddressResultList_foundItems = new ArrayList<Navit_Address_Result_Struct>();
|
222 |
|
225 |
|
223 | public SensorManager sensorManager = null;
|
226 | public SensorManager sensorManager = null;
|
224 | //private static SensorManager sensorManager_ = null;
|
227 | //private static SensorManager sensorManager_ = null;
|
225 |
|
228 |
|
… | |
… | |
1413 | Navit_last_address_search_string = target_address;
|
1416 | Navit_last_address_search_string = target_address;
|
1414 |
|
1417 |
|
1415 | // clear results
|
1418 | // clear results
|
1416 | Navit.NavitAddressResultList_foundItems.clear();
|
1419 | Navit.NavitAddressResultList_foundItems.clear();
|
1417 | Navit.Navit_Address_Result_double_index.clear();
|
1420 | Navit.Navit_Address_Result_double_index.clear();
|
|
|
1421 | Navit.NavitSearchresultBarIndex = -1;
|
|
|
1422 | Navit.NavitSearchresultBar_title = "";
|
|
|
1423 | Navit.NavitSearchresultBar_text = "";
|
1418 |
|
1424 |
|
1419 | if (Navit_last_address_search_string.equals(""))
|
1425 | if (Navit_last_address_search_string.equals(""))
|
1420 | {
|
1426 | {
|
1421 | // empty search string entered
|
1427 | // empty search string entered
|
1422 | Toast.makeText(getApplicationContext(), Navit.get_text("No address found"), Toast.LENGTH_LONG).show(); //TRANS
|
1428 | Toast.makeText(getApplicationContext(), Navit.get_text("No address found"), Toast.LENGTH_LONG).show(); //TRANS
|
… | |
… | |
1761 | }
|
1767 | }
|
1762 |
|
1768 |
|
1763 | // clear results
|
1769 | // clear results
|
1764 | Navit.NavitAddressResultList_foundItems.clear();
|
1770 | Navit.NavitAddressResultList_foundItems.clear();
|
1765 | Navit.Navit_Address_Result_double_index.clear();
|
1771 | Navit.Navit_Address_Result_double_index.clear();
|
|
|
1772 | Navit.NavitSearchresultBarIndex = -1;
|
|
|
1773 | Navit.NavitSearchresultBar_title = "";
|
|
|
1774 | Navit.NavitSearchresultBar_text = "";
|
1766 | Navit.search_results_towns = 0;
|
1775 | Navit.search_results_towns = 0;
|
1767 | Navit.search_results_streets = 0;
|
1776 | Navit.search_results_streets = 0;
|
1768 | Navit.search_results_streets_hn = 0;
|
1777 | Navit.search_results_streets_hn = 0;
|
1769 |
|
1778 |
|
1770 | if (addr.equals(""))
|
1779 | if (addr.equals(""))
|
… | |
… | |
1822 | {
|
1831 | {
|
1823 | if (resultCode == Activity.RESULT_OK)
|
1832 | if (resultCode == Activity.RESULT_OK)
|
1824 | {
|
1833 | {
|
1825 | try
|
1834 | try
|
1826 | {
|
1835 | {
|
1827 | Log.d("Navit", "adress result list id=" + Integer.parseInt(data.getStringExtra("selected_id")));
|
1836 | if (data.getStringExtra("what").equals("view"))
|
1828 | // get the coords for the destination
|
|
|
1829 | int destination_id = Integer.parseInt(data.getStringExtra("selected_id"));
|
|
|
1830 |
|
|
|
1831 | // ok now set target
|
|
|
1832 | Toast.makeText(getApplicationContext(), Navit.get_text("setting destination to") + "\n" + Navit.NavitAddressResultList_foundItems.get(destination_id).addr, Toast.LENGTH_LONG).show(); //TRANS
|
|
|
1833 |
|
|
|
1834 | Message msg = new Message();
|
|
|
1835 | Bundle b = new Bundle();
|
|
|
1836 | b.putInt("Callback", 3);
|
|
|
1837 | b.putString("lat", String.valueOf(Navit.NavitAddressResultList_foundItems.get(destination_id).lat));
|
|
|
1838 | b.putString("lon", String.valueOf(Navit.NavitAddressResultList_foundItems.get(destination_id).lon));
|
|
|
1839 | b.putString("q", Navit.NavitAddressResultList_foundItems.get(destination_id).addr);
|
|
|
1840 | msg.setData(b);
|
|
|
1841 | N_NavitGraphics.callback_handler.sendMessage(msg);
|
|
|
1842 |
|
|
|
1843 | // zoom_to_route();
|
|
|
1844 | try
|
|
|
1845 | {
|
1837 | {
|
1846 | Thread.sleep(400);
|
1838 | // get the coords for the destination
|
|
|
1839 | int destination_id = Integer.parseInt(data.getStringExtra("selected_id"));
|
|
|
1840 |
|
|
|
1841 | try
|
|
|
1842 | {
|
|
|
1843 | Navit.follow_button_off();
|
|
|
1844 | }
|
|
|
1845 | catch (Exception e2)
|
|
|
1846 | {
|
|
|
1847 | e2.printStackTrace();
|
|
|
1848 | }
|
|
|
1849 |
|
|
|
1850 | show_geo_on_screen(Navit.NavitAddressResultList_foundItems.get(destination_id).lat, Navit.NavitAddressResultList_foundItems.get(destination_id).lon);
|
1847 | }
|
1851 | }
|
1848 | catch (InterruptedException e)
|
1852 | else
|
1849 | {
|
1853 | {
|
|
|
1854 | Log.d("Navit", "adress result list id=" + Integer.parseInt(data.getStringExtra("selected_id")));
|
|
|
1855 | // get the coords for the destination
|
|
|
1856 | int destination_id = Integer.parseInt(data.getStringExtra("selected_id"));
|
|
|
1857 |
|
|
|
1858 | // ok now set target
|
|
|
1859 | Toast.makeText(getApplicationContext(), Navit.get_text("setting destination to") + "\n" + Navit.NavitAddressResultList_foundItems.get(destination_id).addr, Toast.LENGTH_LONG).show(); //TRANS
|
|
|
1860 |
|
|
|
1861 | Message msg = new Message();
|
|
|
1862 | Bundle b = new Bundle();
|
|
|
1863 | b.putInt("Callback", 3);
|
|
|
1864 | b.putString("lat", String.valueOf(Navit.NavitAddressResultList_foundItems.get(destination_id).lat));
|
|
|
1865 | b.putString("lon", String.valueOf(Navit.NavitAddressResultList_foundItems.get(destination_id).lon));
|
|
|
1866 | b.putString("q", Navit.NavitAddressResultList_foundItems.get(destination_id).addr);
|
|
|
1867 | msg.setData(b);
|
|
|
1868 | N_NavitGraphics.callback_handler.sendMessage(msg);
|
|
|
1869 |
|
|
|
1870 | // zoom_to_route();
|
|
|
1871 | try
|
|
|
1872 | {
|
|
|
1873 | Thread.sleep(400);
|
|
|
1874 | }
|
|
|
1875 | catch (InterruptedException e)
|
|
|
1876 | {
|
|
|
1877 | }
|
|
|
1878 |
|
|
|
1879 | try
|
|
|
1880 | {
|
|
|
1881 | Navit.follow_button_on();
|
|
|
1882 | }
|
|
|
1883 | catch (Exception e2)
|
|
|
1884 | {
|
|
|
1885 | e2.printStackTrace();
|
|
|
1886 | }
|
|
|
1887 |
|
|
|
1888 | show_geo_on_screen(Navit.NavitAddressResultList_foundItems.get(destination_id).lat, Navit.NavitAddressResultList_foundItems.get(destination_id).lon);
|
1850 | }
|
1889 | }
|
1851 |
|
|
|
1852 | try
|
|
|
1853 | {
|
|
|
1854 | Navit.follow_button_on();
|
|
|
1855 | }
|
|
|
1856 | catch (Exception e2)
|
|
|
1857 | {
|
|
|
1858 | e2.printStackTrace();
|
|
|
1859 | }
|
|
|
1860 |
|
|
|
1861 | show_geo_on_screen(Navit.NavitAddressResultList_foundItems.get(destination_id).lat, Navit.NavitAddressResultList_foundItems.get(destination_id).lon);
|
|
|
1862 | }
|
1890 | }
|
1863 | catch (NumberFormatException e)
|
1891 | catch (NumberFormatException e)
|
1864 | {
|
1892 | {
|
1865 | Log.d("Navit", "NumberFormatException selected_id");
|
1893 | Log.d("Navit", "NumberFormatException selected_id");
|
|
|
1894 | }
|
|
|
1895 | catch (Exception e)
|
|
|
1896 | {
|
|
|
1897 |
|
1866 | }
|
1898 | }
|
1867 | }
|
1899 | }
|
1868 | else
|
1900 | else
|
1869 | {
|
1901 | {
|
1870 | // user pressed back key
|
1902 | // user pressed back key
|
… | |
… | |
2015 | Bundle b = new Bundle();
|
2047 | Bundle b = new Bundle();
|
2016 | msg.what = 10;
|
2048 | msg.what = 10;
|
2017 | b.putInt("dialog_num", this.dialog_num);
|
2049 | b.putInt("dialog_num", this.dialog_num);
|
2018 | b.putInt("max", Navit.ADDRESS_RESULTS_DIALOG_MAX);
|
2050 | b.putInt("max", Navit.ADDRESS_RESULTS_DIALOG_MAX);
|
2019 | b.putInt("cur", this.spinner_current_value % (Navit.ADDRESS_RESULTS_DIALOG_MAX + 1));
|
2051 | b.putInt("cur", this.spinner_current_value % (Navit.ADDRESS_RESULTS_DIALOG_MAX + 1));
|
|
|
2052 | if ((Navit.NavitSearchresultBar_title.equals("")) && (Navit.NavitSearchresultBar_text.equals("")))
|
|
|
2053 | {
|
2020 | b.putString("title", Navit.get_text("getting search results")); //TRANS
|
2054 | b.putString("title", Navit.get_text("getting search results")); //TRANS
|
2021 | b.putString("text", Navit.get_text("searching ...")); //TRANS
|
2055 | b.putString("text", Navit.get_text("searching ...")); //TRANS
|
|
|
2056 | }
|
|
|
2057 | else
|
|
|
2058 | {
|
|
|
2059 | b.putString("title", Navit.NavitSearchresultBar_title);
|
|
|
2060 | b.putString("text", Navit.NavitSearchresultBar_text);
|
|
|
2061 | }
|
2022 | msg.setData(b);
|
2062 | msg.setData(b);
|
2023 | mHandler.sendMessage(msg);
|
2063 | mHandler.sendMessage(msg);
|
2024 | try
|
2064 | try
|
2025 | {
|
2065 | {
|
2026 | Thread.sleep(700);
|
2066 | Thread.sleep(700);
|