public void showColoredEventsDialog()

in android/app/src/main/java/com/appcentersample/AppCenterSampleNativeModule.java [26:47]


    public void showColoredEventsDialog() {
        AlertDialog.Builder builder = new AlertDialog.Builder(getCurrentActivity());
        CharSequence[] colors = {"Yellow", "Blue", "Red"};
        builder.setTitle("Pick a color").setItems(colors, (dialog, index) -> {
            Map<String, String> properties = new HashMap<>();
            switch (index) {
                case 0:
                    properties.put("Color", "Yellow");
                    Analytics.trackEvent("Color event", properties);
                    break;
                case 1:
                    properties.put("Color", "Blue");
                    Analytics.trackEvent("Color event", properties);
                    break;
                case 2:
                    properties.put("Color", "Red");
                    Analytics.trackEvent("Color event", properties);
                    break;
            }
        });
        builder.create().show();
    }