Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
Merge pull request #23 from Connexions/onpause-bug-fix
Browse files Browse the repository at this point in the history
Fixed nullpointer in onPause
  • Loading branch information
edwoodward authored Jan 11, 2017
2 parents 3825921 + 7f3ece1 commit a269f76
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
buildToolsVersion '25.0.0'
project.archivesBaseName = "CNXAndroid";

defaultConfig {
applicationId "org.cnx.android"
minSdkVersion 19
targetSdkVersion 23
versionCode 35
versionName "6.0"
versionCode 36
versionName "6.1"
}
dependencies{
compile 'com.android.support:appcompat-v7:23.4.0'
Expand Down
12 changes: 10 additions & 2 deletions app/src/main/java/org/cnx/android/activity/WebViewActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,18 @@ protected void onPause()
SharedPreferences sharedPref = getSharedPreferences(getString(R.string.cnx_package), MODE_PRIVATE);
SharedPreferences.Editor ed = sharedPref.edit();
WebviewLogic wl = new WebviewLogic();
String bookURL = wl.getBookURL(content.getUrl().toString());
String bookURL = wl.getBookURL(content.getUrl());
//Log.d("onPause", "BookURL - " + bookURL);
//Log.d("WVA.onPause()","URL saved: " + content.getUrl().toString());
String url = webView.getUrl().replace("?bookmark=1", "");
String url;
if(webView.getUrl() != null)
{
url = webView.getUrl().replace("?bookmark=1", "");
}
else
{
url = content.getUrl();
}
ed.putString(bookURL, url);
ed.apply();
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/button_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@color/yellow_background" />
 <item android:state_window_focused="false" android:state_enabled="false"
<item android:state_window_focused="false" android:state_enabled="false"
android:drawable="@color/yellow_background" />
<item android:state_pressed="true"
android:drawable="@color/blue_background" />
Expand Down

0 comments on commit a269f76

Please sign in to comment.