本文整理汇总了Java中android.net.RouteInfo类的典型用法代码示例。如果您正苦于以下问题:Java RouteInfo类的具体用法?Java RouteInfo怎么用?Java RouteInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RouteInfo类属于android.net包,在下文中一共展示了RouteInfo类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: hasDefaultRoute
import android.net.RouteInfo; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private static boolean hasDefaultRoute(LinkProperties linkProperties) {
for(RouteInfo route: linkProperties.getRoutes()) {
if (route.isDefaultRoute()) {
return true;
}
}
return false;
}
开发者ID:syntafin,项目名称:TenguChat,代码行数:10,代码来源:AndroidUsingLinkProperties.java
示例2: hasDefaultRoute
import android.net.RouteInfo; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private static boolean hasDefaultRoute(LinkProperties linkProperties) {
for (RouteInfo route : linkProperties.getRoutes()) {
if (route.isDefaultRoute()) {
return true;
}
}
return false;
}
开发者ID:kriztan,项目名称:Pix-Art-Messenger,代码行数:10,代码来源:AndroidUsingLinkProperties.java
示例3: showIpConfigFields
import android.net.RouteInfo; //导入依赖的package包/类
@SuppressLint("NewApi")
private void showIpConfigFields() {
WifiConfiguration config = null;
mView.findViewById(R.id.ip_fields).setVisibility(View.VISIBLE);
if (mAccessPoint != null && mAccessPoint.networkId != INVALID_NETWORK_ID) {
config = mAccessPoint.getConfig();
}
if (mIpSettingsSpinner.getSelectedItemPosition() == STATIC_IP) {
mView.findViewById(R.id.staticip).setVisibility(View.VISIBLE);
if (mIpAddressView == null) {
mIpAddressView = (TextView) mView.findViewById(R.id.ipaddress);
mIpAddressView.addTextChangedListener(this);
mGatewayView = (TextView) mView.findViewById(R.id.gateway);
mGatewayView.addTextChangedListener(this);
mNetworkPrefixLengthView = (TextView) mView.findViewById(
R.id.network_prefix_length);
mNetworkPrefixLengthView.addTextChangedListener(this);
mDns1View = (TextView) mView.findViewById(R.id.dns1);
mDns1View.addTextChangedListener(this);
mDns2View = (TextView) mView.findViewById(R.id.dns2);
mDns2View.addTextChangedListener(this);
}
if (config != null) {
LinkProperties linkProperties = config.linkProperties;
Iterator<LinkAddress> iterator = linkProperties.getLinkAddresses().iterator();
if (iterator.hasNext()) {
LinkAddress linkAddress = iterator.next();
mIpAddressView.setText(linkAddress.getAddress().getHostAddress());
mNetworkPrefixLengthView.setText(Integer.toString(linkAddress
.getNetworkPrefixLength()));
}
for (RouteInfo route : linkProperties.getRoutes()) {
if (route.isDefaultRoute()) {
mGatewayView.setText(route.getGateway().getHostAddress());
break;
}
}
Iterator<InetAddress> dnsIterator = linkProperties.getDnses().iterator();
if (dnsIterator.hasNext()) {
mDns1View.setText(dnsIterator.next().getHostAddress());
}
if (dnsIterator.hasNext()) {
mDns2View.setText(dnsIterator.next().getHostAddress());
}
}
} else {
mView.findViewById(R.id.staticip).setVisibility(View.GONE);
}
}
开发者ID:voyagewu,项目名称:AndroidSettingDemoAP,代码行数:55,代码来源:WifiConfigController.java
示例4: hasDefaultRoute
import android.net.RouteInfo; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private static boolean hasDefaultRoute(LinkProperties linkProperties) {
for(RouteInfo route: linkProperties.getRoutes()) {
if (route.isDefaultRoute()) {
return true;
}
}
return false;
}
开发者ID:Frozenbox,项目名称:frozenchat,代码行数:10,代码来源:DNSHelper.java
注:本文中的android.net.RouteInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论