Hartley became active in Sinn Féin, serving as the General Secretary in the mid-1980s and the Chair in the early 1990s.[2] In 1993, he was elected to Belfast City Council for the Lower Falls and has held his seat at each subsequent election.[3] Hartley was one of three Sinn Féin candidates in Northern Ireland at the European election in 1994. Although he took only 3.8% of the votes cast and was not elected, he did receive more votes than the party's other candidates.[4] In 2008, Hartley became the second Sinn Féin Lord Mayor of Belfast.[2] In his spare time, he conducts tours of Belfast City Cemetery[5] and authored the 2006 book Written in Stone: The History of Belfast City Cemetery.[6]