Failed to send error message

I am new to android and working on app.help me on this. My magazine is here

  Could not dispatch event: class com.shalom.shalombase.event.RequestPurchaseEvent to handler [EventHandler public void com.shalom.shalombase.activity.MainActivity.onRequestPurchaseEvent(com.shalom.shalombase.event.RequestPurchaseEvent)]: null
        at com.squareup.otto.Bus.throwRuntimeException(Bus.java:456)
        at com.squareup.otto.Bus.dispatch(Bus.java:386)
        at com.squareup.otto.Bus.dispatchQueuedEvents(Bus.java:367)
        at com.squareup.otto.Bus.post(Bus.java:336)

      

Myfragment subcriptionfragment, which dispatches the event to the main activity.

  public class SubscribeFragment extends ShalomBaseFragment {


private Button subscribeLayout;
private LinearLayout subscribebuttonslayout;
private FrameLayout sampleframe;
private RelativeLayout subscribelayout;
View progressLayout;


@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    return inflater.inflate(R.layout.subscribe_layout, container, false);
}

@Subscribe
public void onStoreProgressEvent (StoreProgressEvent event) {

    if(event!=null&&progressLayout!=null)
    {

        if(event.isInProgress)
            progressLayout.setVisibility(View.VISIBLE);
        else
            progressLayout.setVisibility(View.GONE);

    }
}


@Override
public void onViewCreated(View view, Bundle savedInstanceState) {

    super.onViewCreated(view, savedInstanceState);
    initialize(view);

    subscribebuttonslayout.setVisibility(View.VISIBLE);
    subscribelayout.setVisibility(View.VISIBLE);

    subscribeLayout.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            bus.post(new RequestPurchaseEvent(BaseConstants.YEARLY_SUBSCRIPTION));

        }
    });

    getChildFragmentManager().beginTransaction()
            .replace(R.id.sample_frame, new LibrarySamleIssueFragment())
            .commit();



 }

private void initialize(View view) {

    subscribeLayout = (Button) view.findViewById(R.id.button1);
    subscribebuttonslayout = (LinearLayout) view.findViewById(R.id.subscribe_buttons_layout);
    sampleframe = (FrameLayout) view.findViewById(R.id.sample_frame);
    progressLayout = (View) view.findViewById(R.id.progress_layout);
    subscribelayout = (RelativeLayout) view.findViewById(R.id.subscribe_layout);
}



  }

      

Please help me with this. It works fine on S3 but poses a problem on Nexus7. I don't know what the problem is with the code. I'm confused about this

+3


source to share


1 answer


from code:

method.invoke(target, event);

      

next operation:



@Subscribe
public void yourMethod(Event event) {
    //your code throw exception
}

      

your throw method exception thrown by otto

so this is my condition.

+2


source







All Articles