本文整理汇总了Java中android.net.TrafficStats.getThreadStatsTag方法的典型用法代码示例。如果您正苦于以下问题:Java TrafficStats.getThreadStatsTag方法的具体用法?Java TrafficStats.getThreadStatsTag怎么用?Java TrafficStats.getThreadStatsTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.net.TrafficStats
的用法示例。
在下文中一共展示了TrafficStats.getThreadStatsTag方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JavaUrlRequest
import android.net.TrafficStats; //导入方法依赖的package包/类
/**
* @param executor The executor used for reading and writing from sockets
* @param userExecutor The executor used to dispatch to {@code callback}
*/
JavaUrlRequest(Callback callback, final Executor executor, Executor userExecutor, String url,
String userAgent) {
if (url == null) {
throw new NullPointerException("URL is required");
}
if (callback == null) {
throw new NullPointerException("Listener is required");
}
if (executor == null) {
throw new NullPointerException("Executor is required");
}
if (userExecutor == null) {
throw new NullPointerException("userExecutor is required");
}
this.mCallbackAsync = new AsyncUrlRequestCallback(callback, userExecutor);
this.mTrafficStatsTag = TrafficStats.getThreadStatsTag();
this.mExecutor = new Executor() {
@Override
public void execute(final Runnable command) {
executor.execute(new Runnable() {
@Override
public void run() {
int oldTag = TrafficStats.getThreadStatsTag();
TrafficStats.setThreadStatsTag(mTrafficStatsTag);
try {
command.run();
} finally {
TrafficStats.setThreadStatsTag(oldTag);
}
}
});
}
};
this.mCurrentUrl = url;
this.mUserAgent = userAgent;
}
示例2: getThreadStatsTag
import android.net.TrafficStats; //导入方法依赖的package包/类
public static int getThreadStatsTag() {
return TrafficStats.getThreadStatsTag();
}
示例3: b
import android.net.TrafficStats; //导入方法依赖的package包/类
public static int b()
{
return TrafficStats.getThreadStatsTag();
}
示例4: getThreadStatsTag
import android.net.TrafficStats; //导入方法依赖的package包/类
public static int getThreadStatsTag()
{
return TrafficStats.getThreadStatsTag();
}