Speaking at a youth town hall in London on April 23, President Obama talked about social activism and gave some advice to activists, such as those involved in the Black Lives Matter movement. (YouTube/The White House)

LONDON — President Obama, speaking to young activists and leaders at a town hall meeting here Saturday, offered some unsolicited guidance to those pressing for change back home and had some tough words for the Black Lives Matter movement.

The president was asked about the social movements that made him change his mind about issues in the White House. He credited the campaign for marriage equality for gay Americans for leading him to reverse his position, and then he pivoted to the Black Lives Matter movement.

The young black activists have been “really effective in bringing attention to problems” of the criminal justice system and police violence, Obama said.

But he cautioned that the group’s leaders had been too dismissive of elected officials. “Once you’ve highlighted an issue and brought it to people’s attention … then you can't just keep on yelling at them. And you can't refuse to meet because that might compromise the purity of your position,” Obama said.

Obama met with civil rights activists, including representatives of the Black Lives Matter movement, in February at the White House to discuss criminal justice reform. Aislinn Pulley, one of the co-founders of the group’s Chicago chapter, declined the invitation. “I could not, with any integrity, participate in such a sham that would only serve to legitimize the false narrative that the government is working to end police brutality and the institutional racism that fuels it,” Pulley wrote in an essay for Truthout, an online news organization.

Civil rights activists, including those from the Black Lives Matter Movement, met with President Obama at the White House on Feb. 18, to discuss issues ranging from criminal justice reform to policing. (Reuters)

Obama didn’t mention Pulley on Saturday, but he criticized some Black Lives Matter activists who, he said, were unwilling to negotiate with elected leaders.

“The value of social movements and activism is to get you at the table, get you in the room, and then to start trying to figure out how is this problem going to be solved,” Obama said. “You, then, have a responsibility to prepare an agenda that is achievable, that can institutionalize the changes you seek.”

The president also noted that he was speaking from experience. "I started as a community organizer trying to pressure politicians into getting things done," he said. "And now I’m on the other side."