diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/res/values/changelog_master.xml | 3 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/DataStore.java | 5 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/activity/AbstractActivity.java | 9 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/connector/gc/GCParser.java | 17 |
4 files changed, 20 insertions, 14 deletions
diff --git a/main/res/values/changelog_master.xml b/main/res/values/changelog_master.xml index 1e3c3d4..0576519 100644 --- a/main/res/values/changelog_master.xml +++ b/main/res/values/changelog_master.xml @@ -2,5 +2,8 @@ <resources> <!-- changelog for the master branch --> <string name="changelog_master" translatable="false"> + <b>Next feature release:</b>\n + ยท Put features there\n + \n </string> </resources> diff --git a/main/src/cgeo/geocaching/DataStore.java b/main/src/cgeo/geocaching/DataStore.java index 0f9f6bf..d36a9c9 100644 --- a/main/src/cgeo/geocaching/DataStore.java +++ b/main/src/cgeo/geocaching/DataStore.java @@ -3001,8 +3001,9 @@ public class DataStore { private static void clearPreparedStatements() { for (final PreparedStatement preparedStatement : statements) { - if (preparedStatement.statement != null) { - preparedStatement.statement.close(); + final SQLiteStatement statement = preparedStatement.statement; + if (statement != null) { + statement.close(); preparedStatement.statement = null; } } diff --git a/main/src/cgeo/geocaching/activity/AbstractActivity.java b/main/src/cgeo/geocaching/activity/AbstractActivity.java index ba11958..4cddfe6 100644 --- a/main/src/cgeo/geocaching/activity/AbstractActivity.java +++ b/main/src/cgeo/geocaching/activity/AbstractActivity.java @@ -231,7 +231,14 @@ public abstract class AbstractActivity extends ActionBarActivity implements IAbs @Override public NdefMessage createNdefMessage(final NfcEvent event) { final String uri = sharingInterface.getAndroidBeamUri(); - return uri != null ? new NdefMessage(new NdefRecord[]{NdefRecord.createUri(uri)}) : null; + if (uri == null) { + return null; + } + final NdefRecord[] records = { + NdefRecord.createUri(uri), + NdefRecord.createApplicationRecord(CgeoApplication.getInstance().getPackageName()) + }; + return new NdefMessage(records); } }, this); diff --git a/main/src/cgeo/geocaching/connector/gc/GCParser.java b/main/src/cgeo/geocaching/connector/gc/GCParser.java index 014acf7..8371120 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCParser.java +++ b/main/src/cgeo/geocaching/connector/gc/GCParser.java @@ -65,6 +65,7 @@ import android.text.Html; import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.text.ParseException; import java.util.ArrayList; import java.util.Calendar; @@ -1695,28 +1696,22 @@ public abstract class GCParser { Log.e("GCParser.loadLogsFromDetails: error " + statusCode + " when requesting log information"); return Observable.empty(); } - final String rawResponse = Network.getResponseData(response); - if (rawResponse == null) { + final InputStream responseStream = Network.getResponseStream(response); + if (responseStream == null) { Log.e("GCParser.loadLogsFromDetails: unable to read whole response"); return Observable.empty(); } - return parseLogs(logType != Logs.ALL, rawResponse); + return parseLogs(logType != Logs.ALL, responseStream); } }).subscribeOn(RxUtils.networkScheduler); } - private static Observable<LogEntry> parseLogs(final boolean markAsFriendsLog, final String rawResponse) { + private static Observable<LogEntry> parseLogs(final boolean markAsFriendsLog, final InputStream responseStream) { return Observable.create(new OnSubscribe<LogEntry>() { @Override public void call(final Subscriber<? super LogEntry> subscriber) { - // for non logged in users the log book is not shown - if (StringUtils.isBlank(rawResponse)) { - subscriber.onCompleted(); - return; - } - try { - final ObjectNode resp = (ObjectNode) JsonUtils.reader.readTree(rawResponse); + final ObjectNode resp = (ObjectNode) JsonUtils.reader.readTree(responseStream); if (!resp.path("status").asText().equals("success")) { Log.e("GCParser.loadLogsFromDetails: status is " + resp.path("status").asText("[absent]")); subscriber.onCompleted(); |