Skip to content

Commit

Permalink
Bugfix for exporting database.
Browse files Browse the repository at this point in the history
  • Loading branch information
knirirr committed May 8, 2016
1 parent dbff291 commit df3f10e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion beecount/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 115
versionCode 116
}
/*
buildTypes {
Expand Down
2 changes: 1 addition & 1 deletion beecount/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.knirirr.beecount"
android:largeHeap="true"
android:versionName="2.4.2"
android:versionName="2.4.3"
android:installLocation="auto">

<uses-permission android:name="android.permission.WAKE_LOCK" />
Expand Down
12 changes: 9 additions & 3 deletions beecount/src/main/java/com/knirirr/beecount/WelcomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceManager;
Expand Down Expand Up @@ -146,10 +147,15 @@ public void onSharedPreferenceChanged(SharedPreferences prefs, String key)
public void exportDb()
{

int hasWriteContactsPermission = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (hasWriteContactsPermission != PackageManager.PERMISSION_GRANTED)

// if API level > 23
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
{
requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_CODE_ASK_PERMISSIONS);
int hasWriteContactsPermission = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (hasWriteContactsPermission != PackageManager.PERMISSION_GRANTED)
{
requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_CODE_ASK_PERMISSIONS);
}
}
boolean mExternalStorageAvailable = false;
boolean mExternalStorageWriteable = false;
Expand Down
4 changes: 4 additions & 0 deletions beecount/src/main/res/raw/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
</style>
</head>
<body>
$ 2.4.3
% version 2.4.3
_ 2016-05-08
* Bugfix for database exporting.
$ 2.4.2
% version 2.4.2
_ 2016-04-16
Expand Down

0 comments on commit df3f10e

Please sign in to comment.