fix issue 190

git-svn-id: https://osmand.googlecode.com/svn/trunk@693 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-11-23 10:43:19 +00:00
parent 203049d097
commit 8113b196e3
2 changed files with 59 additions and 60 deletions

View file

@ -1,52 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.osmand" android:versionName="0.5.1" android:versionCode="21" android:installLocation="auto">
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true" android:name=".activities.OsmandApplication" android:description="@string/app_description">
<activity android:name=".activities.MainMenuActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.MapActivity" android:label="@string/app_name" android:screenOrientation="portrait"></activity>
<activity android:name=".activities.SettingsActivity" android:label="@string/settings_activity"></activity>
<activity android:name=".activities.search.SearchActivity" android:label="@string/search_activity" ></activity>
<activity android:name=".activities.NavigatePointActivity"></activity>
<activity android:name=".activities.DownloadIndexActivity"></activity>
<activity android:name=".activities.ShowRouteInfoActivity"></activity>
<activity android:name=".activities.FavouritesActivity" android:label="@string/favourites_activity"></activity>
<activity android:name=".activities.search.SearchPOIActivity" android:label="@string/searchpoi_activity"></activity>
<activity android:name=".activities.search.SearchPoiFilterActivity"></activity>
<activity android:name=".activities.search.SearchAddressOnlineActivity"></activity>
<activity android:name=".activities.search.SearchAddressActivity"></activity>
<activity android:name=".activities.search.SearchTransportActivity"></activity>
<activity android:name=".activities.search.SearchHistoryActivity"></activity>
<activity android:name=".activities.search.SearchCityByNameActivity"></activity>
<activity android:name=".activities.search.SearchRegionByNameActivity"></activity>
<activity android:name=".activities.search.SearchStreetByNameActivity"></activity>
<activity android:name=".activities.search.SearchStreet2ByNameActivity"></activity>
<activity android:name=".activities.search.SearchBuildingByNameActivity"></activity>
<activity android:name=".activities.EditPOIFilterActivity"></activity>
<service android:process="net.osmand" android:label="@string/process_navigation_service" android:name=".NavigationService">
<intent-filter><action android:name="net.osmand.NavigationService"></action></intent-filter>
</service>
</application>
<!-- comment change build properties for release & set targetSdkVersion="7", build and reverse changes-->
<!-- <uses-sdk android:minSdkVersion="3"/> -->
<!-- uncomment it to allow different screen supports (large/small)-->
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.osmand" android:versionName="0.5.1" android:versionCode="21" android:installLocation="auto">
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true" android:name=".activities.OsmandApplication" android:description="@string/app_description">
<activity android:name=".activities.MainMenuActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.MapActivity" android:label="@string/app_name" android:screenOrientation="portrait"></activity>
<activity android:name=".activities.SettingsActivity" android:label="@string/settings_activity"></activity>
<activity android:name=".activities.search.SearchActivity" android:label="@string/search_activity" ></activity>
<activity android:name=".activities.NavigatePointActivity"></activity>
<activity android:name=".activities.DownloadIndexActivity" android:configChanges="keyboardHidden|orientation"></activity>
<activity android:name=".activities.ShowRouteInfoActivity"></activity>
<activity android:name=".activities.FavouritesActivity" android:label="@string/favourites_activity"></activity>
<activity android:name=".activities.search.SearchPOIActivity" android:label="@string/searchpoi_activity"></activity>
<activity android:name=".activities.search.SearchPoiFilterActivity"></activity>
<activity android:name=".activities.search.SearchAddressOnlineActivity"></activity>
<activity android:name=".activities.search.SearchAddressActivity"></activity>
<activity android:name=".activities.search.SearchTransportActivity"></activity>
<activity android:name=".activities.search.SearchHistoryActivity"></activity>
<activity android:name=".activities.search.SearchCityByNameActivity"></activity>
<activity android:name=".activities.search.SearchRegionByNameActivity"></activity>
<activity android:name=".activities.search.SearchStreetByNameActivity"></activity>
<activity android:name=".activities.search.SearchStreet2ByNameActivity"></activity>
<activity android:name=".activities.search.SearchBuildingByNameActivity"></activity>
<activity android:name=".activities.EditPOIFilterActivity"></activity>
<service android:process="net.osmand" android:label="@string/process_navigation_service" android:name=".NavigationService">
<intent-filter><action android:name="net.osmand.NavigationService"></action></intent-filter>
</service>
</application>
<!-- comment change build properties for release & set targetSdkVersion="7", build and reverse changes-->
<!-- <uses-sdk android:minSdkVersion="3"/> -->
<!-- uncomment it to allow different screen supports (large/small)-->
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
</manifest>

View file

@ -30,8 +30,8 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@ -46,11 +46,10 @@ import net.osmand.data.index.IndexConstants;
import org.apache.commons.logging.Log;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.os.Environment;
import android.text.Editable;
@ -100,8 +99,7 @@ public class DownloadIndexActivity extends ListActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// that is needed to prevent rotation while files are downloaded
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
// recreation upon rotation is prevented in manifest file
setContentView(R.layout.download_index);
findViewById(R.id.DownloadButton).setOnClickListener(new View.OnClickListener(){
@ -125,13 +123,13 @@ public class DownloadIndexActivity extends ListActivity {
private void downloadIndexList() {
progressListDlg = ProgressDialog.show(this, getString(R.string.downloading), getString(R.string.downloading_list_indexes));
progressListDlg.setCancelable(true);
downloadListIndexThread.uiActivity = this;
downloadListIndexThread.setUiActivity(this);
if(downloadListIndexThread.getState() == Thread.State.NEW){
downloadListIndexThread.start();
} else if(downloadListIndexThread.getState() == Thread.State.TERMINATED){
// possibly exception occurred we don't have cache of files
downloadListIndexThread = new DownloadIndexListThread();
downloadListIndexThread.uiActivity = this;
downloadListIndexThread.setUiActivity(this);
}
}
@ -385,6 +383,7 @@ public class DownloadIndexActivity extends ListActivity {
@Override
public void run() {
((DownloadIndexAdapter) getListAdapter()).notifyDataSetChanged();
findViewById(R.id.DownloadButton).setVisibility(entriesToDownload.isEmpty() ? View.GONE : View.VISIBLE);
}
});
}
@ -491,7 +490,7 @@ public class DownloadIndexActivity extends ListActivity {
EditText filterText = (EditText) findViewById(R.id.search_box);
filterText.removeTextChangedListener(textWatcher);
}
downloadListIndexThread.uiActivity = null;
downloadListIndexThread.setUiActivity(null);
progressFileDlg = null;
}