Skip to content

Can't stop listening #13

@corentinc-old

Description

@corentinc-old

Hi!

Thank you a lot for your sharing your work!

stopListening() does nothing. The visualizer is still updated.

Context :
I want to start listening when I click on the start button, then stop when I click on another button.

Did anybody face this behavior?

public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
    view = inflater.inflate(R.layout.record_sound, container, false);
    visualizer = view.findViewById(R.id.visualizer);

    view.findViewById(R.id.start).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            visualizer.startListening();
        }
    });

    view.findViewById(R.id.stop).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            visualizer.stopListening();
        }
    });
    return view;
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions