Last active
August 4, 2017 04:28
-
-
Save Bruno125/017261ec616f2ebe06ffa7be9e46974b to your computer and use it in GitHub Desktop.
Simple class with custom listener
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
package com.example.pack.one; | |
public class MyClass { | |
interface Listener{ | |
void foo(); | |
} | |
private Listener mListener; | |
public void setListener(Listener listener) { | |
mListener = listener; | |
} | |
public void run(){ | |
if(mListener != null){ | |
mListener.foo(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment