A large white settler population occupying much of the best land made the transition to independence in Kenya more bitter than in other East African countries. African opposition to white rule began to emerge in Kikuyu political organizations in the 1920s. Jomo Kenyatta became leader in 1928 of the Kikuyu Central Association, which started in the 1930s to represent Africans more generally until banned in 1940. After the war the British began to allow very limited African representation on the legislative council and then the Governor’s Executive Council, but settler resistance encouraged African support for the new Kenyan African National Union, which agitated on issues of representation, land and racial discrimination. The Mau Mau violent uprising began in 1952 and continued until 1956, and the British government imposed an emergency until 1959, during which Kenyatta and other Kikuyu leaders were detained (although they denied direct involvement with Mau Mau) along with 70,000 others. The shock of Mau Mau and revelations about deaths and ill treatment in the camps speeded up transfer of power to Africans, despite problems caused by the settlers and by divisions between African parties. Kenya achieved independence in December 1963.
There were nonviolent protests before independence. A major nonviolent rural campaign involving a mass march on Nairobi was waged in 1938 by the Wakamba (supported by some other tribal groups) against colonial soil erosion policies, which meant economically disastrous enforced destocking. The leaders were arrested. See:
There were also frequent strikes, including the 1947 Mombasa dock strike and general strikes in Mombasa and Nairobi, and there was a debate about ‘positive action’ versus violent resistance.