本文整理汇总了Java中android.net.Uri.getFragment方法的典型用法代码示例。如果您正苦于以下问题:Java Uri.getFragment方法的具体用法?Java Uri.getFragment怎么用?Java Uri.getFragment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.net.Uri
的用法示例。
在下文中一共展示了Uri.getFragment方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: needsSpecialsInAssetUrlFix
import android.net.Uri; //导入方法依赖的package包/类
private static boolean needsSpecialsInAssetUrlFix(Uri uri) {
if (CordovaResourceApi.getUriType(uri) != CordovaResourceApi.URI_TYPE_ASSET) {
return false;
}
if (uri.getQuery() != null || uri.getFragment() != null) {
return true;
}
if (!uri.toString().contains("%")) {
return false;
}
switch(Build.VERSION.SDK_INT){
case Build.VERSION_CODES.ICE_CREAM_SANDWICH:
case Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1:
return true;
}
return false;
}
示例2: needsSpecialsInAssetUrlFix
import android.net.Uri; //导入方法依赖的package包/类
private static boolean needsSpecialsInAssetUrlFix(Uri uri) {
if (CordovaResourceApi.getUriType(uri) != CordovaResourceApi.URI_TYPE_ASSET) {
return false;
}
if (uri.getQuery() != null || uri.getFragment() != null) {
return true;
}
if (!uri.toString().contains("%")) {
return false;
}
switch(android.os.Build.VERSION.SDK_INT){
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH:
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1:
return true;
}
return false;
}
示例3: createHost
import android.net.Uri; //导入方法依赖的package包/类
@Override
public HostBean createHost(Uri uri) {
HostBean host = new HostBean();
host.setProtocol(PROTOCOL);
host.setHostname(uri.getHost());
int port = uri.getPort();
if (port < 0 || port > 65535)
port = DEFAULT_PORT;
host.setPort(port);
String nickname = uri.getFragment();
if (nickname == null || nickname.length() == 0) {
host.setNickname(getDefaultNickname(host.getUsername(),
host.getHostname(), host.getPort()));
} else {
host.setNickname(uri.getFragment());
}
return host;
}
示例4: createHost
import android.net.Uri; //导入方法依赖的package包/类
@Override
public HostBean createHost(Uri uri) {
HostBean host = new HostBean();
host.setProtocol(PROTOCOL);
host.setHostname(uri.getHost());
int port = uri.getPort();
if (port < 0)
port = DEFAULT_PORT;
host.setPort(port);
host.setUsername(uri.getUserInfo());
String nickname = uri.getFragment();
if (nickname == null || nickname.length() == 0) {
host.setNickname(getDefaultNickname(host.getUsername(),
host.getHostname(), host.getPort()));
} else {
host.setNickname(uri.getFragment());
}
return host;
}
示例5: createHost
import android.net.Uri; //导入方法依赖的package包/类
@Override
public HostBean createHost(Uri uri) {
HostBean host = new HostBean();
host.setProtocol(PROTOCOL);
String nickname = uri.getFragment();
if (nickname == null || nickname.length() == 0) {
host.setNickname(getDefaultNickname(host.getUsername(),
host.getHostname(), host.getPort()));
} else {
host.setNickname(uri.getFragment());
}
return host;
}
示例6: needsSpecialsInAssetUrlFix
import android.net.Uri; //导入方法依赖的package包/类
private static boolean needsSpecialsInAssetUrlFix(Uri uri) {
if (CordovaResourceApi.getUriType(uri) != CordovaResourceApi.URI_TYPE_ASSET) {
return false;
}
if (uri.getQuery() != null || uri.getFragment() != null) {
return true;
}
if (!uri.toString().contains("%")) {
return false;
}
switch (android.os.Build.VERSION.SDK_INT) {
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH:
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1:
return true;
}
return false;
}
示例7: matchesSafely
import android.net.Uri; //导入方法依赖的package包/类
@Override
protected boolean matchesSafely(Uri item) {
if (!item.isAbsolute()
|| !item.isHierarchical()
|| TextUtils.isEmpty(item.getScheme())
|| TextUtils.isEmpty(item.getAuthority())) {
return false;
}
if (!mPermittedSchemes.isEmpty() && !mPermittedSchemes.contains(item.getScheme())) {
return false;
}
if (mAllowPathQueryOrFragment) {
return true;
}
return TextUtils.isEmpty(item.getPath())
&& item.getQuery() == null
&& item.getFragment() == null;
}
示例8: needsSpecialsInAssetUrlFix
import android.net.Uri; //导入方法依赖的package包/类
private static boolean needsSpecialsInAssetUrlFix(Uri uri) {
if (CordovaResourceApi.getUriType(uri) != CordovaResourceApi.URI_TYPE_ASSET) {
return false;
}
if (uri.getQuery() != null || uri.getFragment() != null) {
return true;
}
if (!uri.toString().contains("%")) {
return false;
}
switch(android.os.Build.VERSION.SDK_INT){
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH:
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1:
return true;
}
return false;
}
示例9: onCreate
import android.net.Uri; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
Intent intent = getIntent();
if (intent != null) {
Uri data = getIntent().getData();
if (data != null) {
String host = data.getHost();
String path = data.getPath();
String param = data.getQueryParameter("key1");
String fragment = data.getFragment();
Log.e("TAG", "host:" + host);
Log.e("TAG", "path:" + path);
Log.e("TAG", "param:" + param);
Log.e("TAG", "fragment:" + fragment);
}
}
}