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"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.fox.ttrss"
|
package="org.fox.ttrss"
|
||||||
android:versionCode="236"
|
android:versionCode="236"
|
||||||
android:versionName="1.39" >
|
android:versionName="1.40" >
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="8"
|
android:minSdkVersion="8"
|
||||||
|
@ -143,11 +143,23 @@ public class SubscribeActivity extends CommonShareActivity {
|
|||||||
if (m_lastError != ApiError.NO_ERROR) {
|
if (m_lastError != ApiError.NO_ERROR) {
|
||||||
toast(getErrorMessage());
|
toast(getErrorMessage());
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
switch (m_apiStatusCode) {
|
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:
|
case 0:
|
||||||
toast(R.string.error_feed_already_exists_);
|
toast(R.string.error_feed_already_exists_);
|
||||||
finish();
|
//finish();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
toast(R.string.subscribed_to_feed);
|
toast(R.string.subscribed_to_feed);
|
||||||
|
Loading…
Reference in New Issue
Block a user