문제

I have an BaseActivity which all of my other activities extending this. I have a public item which my all activites can open it. How can i listen this view's click from my BaseActivity ?

Example

 Activity 1 (Base) > VideoActivity > LoginView
 Activity 1 (Base) > MusicActivity > LoginView

I have a button in login view and when i click it gives an error that VideoActivity don't have a method clicklistener. My click listener method is at baseActivity

Waiting for your help Thanks

도움이 되었습니까?

해결책

Assuming LoginView extends BaseActivity and BaseActivity implements OnClickListener

button.setOnClickListener(new YourOnClickListener(), LoginView.this);

If this doesn't fix your problem then please post relevant code

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top