A activity에서 '12345'를 입력하고 확인버튼을 누르면 B activity에서 '12345'가 출력되었으면 좋겠습니다.
물론 설명을 간단히 하느라 당연히 intent를 쓰면되는 상황처럼 적었는데,
interface로 동작시켜야하는 상황입니다.
===== ===== ===== ===== =====
A activity에서 interface생성
EventListener mListener;
public interface EventListener { ... }
public void setListener(EventListener listener) { mListener = listener}
여기까지는 맞는거 같은데.... 이 다음에 interface적용 부분을 잘 모르겠습니다.
B activity에서 적용하는 부분...
A_activity a = new A_activity();
a.setListener(new EventListener() {
@Override
... 기능 구현 ...
});
이런식으로 했더니 Attempt to invoke interface method... 오류가 뜹니다 ㅠㅠ
생성 후 연결하는 방법에 대해서 알려주시면 감사하겠습니다!!!