Java tutorial
//package com.java2s; //License from project: Open Source License import android.net.Uri; import android.support.annotation.Nullable; import android.text.TextUtils; public class Main { static void assertUriSafe(@Nullable Uri uri) { if (uri == null || TextUtils.isEmpty(uri.getScheme()) || TextUtils.isEmpty(uri.getHost())) { throw new RuntimeException("Unsafe uri provided"); } } }