I am trying to call the method getFailureDialog() of the interface OnSelectedListener.
The method is implemented in MainActivity.java.
add a method in
public class Common
{
OnSelectedListener mCallback;
public void setOnSelectedListener(OnSelectedListener listener){
mCallback = listener;
}
public interface OnSelectedListener
{
public void getFailureDialog();
}
public void myRecord(String email)
{
mCallback.getFailureDialog(); //null pointer exception here
}
}
now use the setOnSelectedListener() to initialize your listener
but from you code you might need to implement another listener in your SharedFragment too.