i have this code in class A
private RtcListener mListener;
@Override
public void Update(String string) {
//here its work now i want to pass data to Interface
mListener.onUpdate(sometext);
}
public interface RtcListener{
void onUpdate(String string);
}
now in another class and its B
i implements the Interface
public class B extends Service implements A.RtcListener{
// here i Override interface method
@Override
public void onUpdate(String string) {
Log.d("dwdwadwadwd"," the data is"+string);
}
}
its give me the error
Attempt to invoke interface method 'void ..... on a null object reference