我正在尝试以编程方式重置Google Advertising ID以实现自动化目的.
我可以获取广告ID和isLimitAdTrackingEnabled.但我想以编程方式重置ID
用户可以手动重置谷歌设置应用程序中的谷歌广告ID.
minSdkVersion 18
targetSdkVersion 27
Run Code Online (Sandbox Code Playgroud)
使用以下代码,我可以打开Google设置页面.
private static final String GOOGLE_SETTINGS_COMPONENT = "com.google.android.gms";
private static final String GOOGLE_SETTINGS_ACTIVITY = ".app.settings.GoogleSettingsActivity";
Intent i = new Intent();
i.setClassName(GOOGLE_SETTINGS_COMPONENT,GOOGLE_SETTINGS_COMPONENT + GOOGLE_SETTINGS_ACTIVITY);
try {
startActivity(i);
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(getApplicationContext(), "Activity Not Found", Toast.LENGTH_LONG).show();
}
Run Code Online (Sandbox Code Playgroud)
android android-intent google-play android-settings google-settings