0

I'm using ShinobiCharts in a project to draw graphs. The library draws graphs in a ChartFragments. I have an activity with two frame layouts and I'm adding chartfragments to each one. I've added click listeners to these frame layouts but they do not register an event. Is there a way to add an onClickListener to a frame layout that contains a fragment?

Thanks

W.K.S
  • 9,787
  • 15
  • 75
  • 122

1 Answers1

1

Try adding this to your Fragment classes:

@Override
public void onViewCreated(View view, Bundle savedInstanceState){
    view.setOnClickListener(new OnClickListener(){

        @Override
        public void onClick(View v){
             // do whatever you want here
        }
    });
}

EDIT: Since the library in question doesn't allow access to the XML layout, W.K.S implemented it using OnGestureListener and onSingleTouchUp().

Community
  • 1
  • 1
Yash Sampat
  • 30,051
  • 12
  • 94
  • 120