protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case Navit.NavitDownloaderSelectMap_id : if (resultCode == Activity.RESULT_OK) { Message msg = dialogs.obtainMessage(NavitDialogs.MSG_START_MAP_DOWNLOAD , data.getIntExtra("map_index", -1), 0); msg.sendToTarget(); } break; case NavitAddressSearch_id : if (resultCode == Activity.RESULT_OK) { Bundle destination = data.getExtras(); Toast.makeText( getApplicationContext(),getString(R.string.address_search_set_destination) + "\n" + destination.getString(("q")), Toast.LENGTH_LONG).show(); //TRANS Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal()); msg.setData(destination); msg.sendToTarget(); } break; case NavitSelectStorage_id : if(resultCode == RESULT_OK) { String newDir = data.getStringExtra(FileBrowserActivity.returnDirectoryParameter); Log.d(TAG, "selected path= "+newDir); if(!newDir.contains("/navit")) newDir = newDir+"/navit/"; else newDir = newDir+"/"; SharedPreferences prefs = this.getSharedPreferences(NAVIT_PREFS,MODE_PRIVATE); SharedPreferences.Editor prefs_editor = prefs.edit(); prefs_editor.putString("filenamePath", newDir); prefs_editor.commit(); Toast.makeText(this, String.format(Navit._("New location set to %s\nRestart Navit to apply the changes."),newDir),Toast.LENGTH_LONG).show(); } else Log.w(TAG, "select path failed"); break; default : //Log.e("Navit", "onActivityResult " + requestCode + " " + resultCode); ActivityResults[requestCode].onActivityResult(requestCode, resultCode, data); break; } }
protected Dialog onCreateDialog(int id) { return dialogs.createDialog(id); }
@Override protected void onPrepareDialog(int id, Dialog dialog) { dialogs.prepareDialog(id, dialog); super.onPrepareDialog(id, dialog); }