Excluding an Interaction

Exclude a specific view from being automatically recognized as an Interaction, using the mxoExcludeAutomaticInteraction Kotlin extension function or MedalliaMXO.excludeAutomaticInteraction Java method in an Activity's onCreate method or a Fragment's onViewCreated, as shown below:

import com.medallia.mxo.mxoExcludeAutomaticInteraction

// Activity example.
override fun onCreate(savedInstanceState: Bundle?) {
    	super.onCreate(savedInstanceState)
    	mxoExcludeAutomaticInteraction {
            this.view = findViewById(R.id.example_id)
        }
}

// Fragment example. 
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
	mxoExcludeAutomaticInteraction {
            	this.view = view
        }
}
import com.medallia.mxo.MedalliaMXO;
import com.medallia.mxo.automatic.MXOAutomaticInteractionExclusion;

// Activity example.
@Override
protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
	LinearLayout linearLayout = findViewById(R.id.example_id);
        final MXOAutomaticInteractionExclusion mxoAutomaticInteractionExclusion = new MXOAutomaticInteractionExclusion.Builder()
                .view(linearLayout)
		.build();
        MedalliaMXO.excludeAutomaticInteraction(mxoAutomaticInteractionExclusion);
}

// Fragment example.
@Override
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
	super.onViewCreated(view, savedInstanceState);
        final MXOAutomaticInteractionExclusion viewExclusion = new MXOAutomaticInteractionExclusion.Builder()
                .view (view)
                .build();
        MedalliaMXO.excludeAutomaticInteraction(viewExclusion);
}