本文整理汇总了Java中android.telephony.TelephonyManager.getDataActivity方法的典型用法代码示例。如果您正苦于以下问题:Java TelephonyManager.getDataActivity方法的具体用法?Java TelephonyManager.getDataActivity怎么用?Java TelephonyManager.getDataActivity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.telephony.TelephonyManager
的用法示例。
在下文中一共展示了TelephonyManager.getDataActivity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDataActivity
import android.telephony.TelephonyManager; //导入方法依赖的package包/类
String getDataActivity(TelephonyManager tm) {
int direction = tm.getDataActivity();
mDataActivityTypeShort = "un";
mDataActivityType = "undef";
switch (direction) {
case TelephonyManager.DATA_ACTIVITY_NONE:
mDataActivityTypeShort = "No";
mDataActivityType = "None";
break;
case TelephonyManager.DATA_ACTIVITY_IN:
mDataActivityTypeShort = "In";
mDataActivityType = "In";
break;
case TelephonyManager.DATA_ACTIVITY_OUT:
mDataActivityTypeShort = "Ou";
mDataActivityType = "Out";
break;
case TelephonyManager.DATA_ACTIVITY_INOUT:
mDataActivityTypeShort = "IO";
mDataActivityType = "In-Out";
break;
case TelephonyManager.DATA_ACTIVITY_DORMANT:
mDataActivityTypeShort = "Do";
mDataActivityType = "Dormant";
break;
}
return mDataActivityType;
}