fix result code not parsed properly when subscribing to feeds
This commit is contained in:
parent
5473fab84c
commit
99d844aea8
@ -2,7 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.fox.ttrss"
|
||||
android:versionCode="236"
|
||||
android:versionName="1.39" >
|
||||
android:versionName="1.40" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="8"
|
||||
|
@ -143,11 +143,23 @@ public class SubscribeActivity extends CommonShareActivity {
|
||||
if (m_lastError != ApiError.NO_ERROR) {
|
||||
toast(getErrorMessage());
|
||||
} else {
|
||||
try {
|
||||
switch (m_apiStatusCode) {
|
||||
try {
|
||||
int rc = -1;
|
||||
|
||||
try {
|
||||
rc = result.getAsJsonObject().get("status").getAsJsonObject().get("code").getAsInt();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
switch (rc) {
|
||||
case -1:
|
||||
toast(R.string.error_api_unknown);
|
||||
//finish();
|
||||
break;
|
||||
case 0:
|
||||
toast(R.string.error_feed_already_exists_);
|
||||
finish();
|
||||
//finish();
|
||||
break;
|
||||
case 1:
|
||||
toast(R.string.subscribed_to_feed);
|
||||
|
Loading…
Reference in New Issue
Block a user