本文整理匯總了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);
}
}
}