How were the reactions of African and Muslim rulers to imperialism similar?

How were the reactions of African and Muslim rulers to imperialism similar? How were they different?