How to disable touch in fragment area

salih picture salih · Feb 6, 2015 · Viewed 7.4k times · Source

I am developing an app that have map and fragment. Map Contents is fragment in front of map. When i touch in map contens fragment map affected from my touch and zoom in, zoom out etc. All i want to do is disable touch event on map contents fragment but i dont want to lose my click events in map contents fragment. Only disable fragment area for map content.

I have framelayout and added it when click actionbar menu items.

Thanks in helpings.

Here my code;

FragmentManager fm = getFragmentManager();
            fm.beginTransaction();
            FragmentTransaction fragmentTransaction = fm.beginTransaction();
            if (fragmentmapcontent.isVisible()) {
                fragmentTransaction.hide(fragmentmapcontent);


            } else {


                if (fragmentmapcontent.isAdded()) {

                } else {
                    fragmentTransaction.add(R.id.mapcontents, fragmentmapcontent, "Map Content");

                }


                fragmentTransaction.show(fragmentmapcontent);

            }
            fragmentTransaction.commit();

enter image description here

Answer

salih picture salih · Feb 12, 2015

Solve this issue.

When make fragment clickable:true, everything works okey.