Add composite subscriptions

This commit is contained in:
inorichi
2015-10-01 16:52:08 +02:00
parent e386257d34
commit 90b0948968
7 changed files with 35 additions and 46 deletions

View File

@@ -4,19 +4,8 @@ import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import retrofit.HttpException;
public class NetworkUtil {
/**
* Returns true if the Throwable is an instance of RetrofitError with an
* http status code equals to the given one.
*/
public static boolean isHttpStatusCode(Throwable throwable, int statusCode) {
return throwable instanceof HttpException
&& ((HttpException) throwable).code() == statusCode;
}
public static boolean isNetworkConnected(Context context) {
ConnectivityManager cm =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);