Show error if changelog can't load

This commit is contained in:
Moez Bhatti
2015-12-06 12:20:47 -05:00
parent 20520ca8f6
commit 0d9ac4ff10
3 changed files with 9 additions and 1 deletions
@@ -73,7 +73,7 @@ public class DialogHelper {
}, error -> { }, error -> {
Log.d(TAG, "onError: " + error.getMessage()); Log.d(TAG, "onError: " + error.getMessage());
context.hideProgressDialog(); context.hideProgressDialog();
context.makeToast(R.string.toast_changelog_error);
}); });
context.getRequestQueue().add(request); context.getRequestQueue().add(request);
@@ -10,6 +10,7 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.PowerManager; import android.os.PowerManager;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.StringRes;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.util.Log; import android.util.Log;
@@ -19,6 +20,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.Toast;
import com.android.volley.RequestQueue; import com.android.volley.RequestQueue;
import com.moez.QKSMS.QKSMSApp; import com.moez.QKSMS.QKSMSApp;
import com.moez.QKSMS.R; import com.moez.QKSMS.R;
@@ -227,6 +229,10 @@ public abstract class QKActivity extends ActionBarActivity {
} }
} }
public void makeToast(@StringRes int message) {
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
}
public RequestQueue getRequestQueue() { public RequestQueue getRequestQueue() {
return ((QKSMSApp) getApplication()).getRequestQueue(); return ((QKSMSApp) getApplication()).getRequestQueue();
} }
+2
View File
@@ -620,6 +620,8 @@
<string name="toast_billing_not_available">Purchase requires Google Play Store (billing) on your Android</string> <string name="toast_billing_not_available">Purchase requires Google Play Store (billing) on your Android</string>
<!--Toast shown when Google Play Services is not available for purchasing a product--> <!--Toast shown when Google Play Services is not available for purchasing a product-->
<string name="toast_endlessjabber_not_installed">EndlessJabber is not installed, opening Google Play</string> <string name="toast_endlessjabber_not_installed">EndlessJabber is not installed, opening Google Play</string>
<string name="toast_changelog_error">Couldn\'t load the changelog. Please try again later</string>
<!--Toast shown to thank user for donating--> <!--Toast shown to thank user for donating-->
<string name="thanks_1">Thank you for donating! You\'re my new best friend.</string> <string name="thanks_1">Thank you for donating! You\'re my new best friend.</string>
<!--Toast shown to thank user for donating--> <!--Toast shown to thank user for donating-->