Skip to content

An Android library to detect when a user has taken a screenshot of your app

License

Notifications You must be signed in to change notification settings

Esc861/ScreenshotListener

Repository files navigation

ScreenshotListener

What is it?

An Android library to detect when a user has taken a screenshot of your app.

Usage

ScreenshotListener is in the jCenter Maven repository

In your build.gradle:

dependencies {
	compile 'com.esc861.screenshotlistener:screenshotlistener:1.0.3'
}

In an activity (or any class) that wants to listen for screenshots

ScreenshotListener listener;

@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	listener = new ScreenshotListener() {
		@Override
		public void onScreenshotDetected(String path) {
			//Screenshot detected
		}
	};
}

@Override
protected void onResume() {
	super.onResume();
	listener.startListening();
}

@Override
protected void onPause() {
	super.onPause();
	listener.stopListening();
}

Author

About

An Android library to detect when a user has taken a screenshot of your app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages