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