mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-18 15:07:30 +01:00
Add composite subscriptions
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user