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