Skip to content
A simple Android library to show Privacy Policy, Terms of Service and General Data Protection Regulation (GDPR)
Branch: master
Clone or download
Latest commit 80ab994 Sep 9, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Added Europe only Sep 8, 2018
art Init Apr 27, 2018
build/kotlin-build Added Europe only Sep 8, 2018
gradle/wrapper Init Apr 27, 2018
library Added Europe only Sep 8, 2018
Android-Privacy-Policy.iml Added Europe only Sep 8, 2018 Update Sep 8, 2018
build.gradle Init Apr 27, 2018 Init Apr 27, 2018
gradlew Init Apr 27, 2018
gradlew.bat Init Apr 27, 2018 Added Europe only Sep 8, 2018
settings.gradle Init Apr 27, 2018


A simple Android library to show Privacy Policy, Terms of Service and General Data Protection Regulation (GDPR).

Api-level 16+



Add the repository to your gradle app

allprojects {
    repositories {
        maven { url '' }

dependencies {
    implementation 'com.github.khirr:Android-Privacy-Policy:1.0.1'

Add this view to your code

// Initialice your dialog, first param is your terms of service url, and second param is your privacy policy url

PrivacyPolicyDialog dialog = new PrivacyPolicyDialog(this,

Add your policy lines, the most import for users, your full policy and terms of service are on your urls.

dialog.addPoliceLine("This application uses a unique user identifier for advertising purposes, it is shared with third-party companies.");
dialog.addPoliceLine("This application sends error reports, installation and send it to a server of the company to analyze and process it.");
dialog.addPoliceLine("This application requires internet access and must collect the following information: Installed applications and history of installed applications, ip address, unique installation id, token to send notifications, version of the application, time zone and information about the language of the device.");
dialog.addPoliceLine("All details about the use of data are available in our Privacy Policies, as well as all Terms of Service links below.");

Add your listener

final Intent intent = new Intent(this, SecondActivity.class);

dialog.setOnClickListener(new PrivacyPolicyDialog.OnClickListener() {
    public void onAccept(boolean isFirstTime) {
        Log.e("MainActivity", "Policies accepted");

    public void onCancel() {
        Log.e("MainActivity", "Policies not accepted");

Enable for Europe only


Full dialog customizing

//  Example
dialog.setAcceptButtonColor(ContextCompat.getColor(this, R.color.colorAccent));



You can’t perform that action at this time.