Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top