Created
March 5, 2015 16:13
-
-
Save jinqian/d217546ca2e406006681 to your computer and use it in GitHub Desktop.
set ad id in cookies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
AdvertisingIdClient.Info adInfo = null; | |
try { | |
adInfo = AdvertisingIdClient.getAdvertisingIdInfo(mContext); | |
} catch (IOException | GooglePlayServicesNotAvailableException | GooglePlayServicesRepairableException e) { | |
e.printStackTrace(); | |
} | |
String advertisingId = ""; | |
if (adInfo != null) { | |
advertisingId = adInfo.getId(); | |
} | |
mCookieManager.initCookies(mContext, eventType, advertisingId); | |
} | |
}).start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment