i am newbie in Android native development.while tracing code i found this code,but unable to understand what that does ..
My doubt in these is ,
1.)if we are using a interface methods in Activity.java ,shouldnt i make Activity.java to use implement keyword to implement those methods mentioned in Icommand Interface.
2.)If not then What is it doing here.is Variable onsuccess is an object or instance of interface?
please could anyone help me to understand this.
In Icommand.java
public interface ICommand<T, S> {
public T execute(S params) throws Exception;
}
In Activity.java
public class Activity extends BaseActivity {
private ICommand<Void, String> onSuccess = new ICommand<Void, String>() {
@Override
public Void execute(String params) throws Exception {
Activity.this.setPreferenceValue(Constants.PREF_PHONENUMBER, params);
Activity.this.setPreferenceValue(Constants.PREF_HASPHONENUMBER, "true");
Activity.this.finish();
return null;
}
};
}