"Africans" cannot votes in American elections, first of all. Secondly, Africa is a continent, not a country.
If you are speaking of voters who happen to be black and/or use the term "African-American" to self identify. Black people in America are Americans.
As for the question, black Americans voted for Obama because they felt that he identified and understood their needs and concerns. For many he is an inspiration. Black Americans don't vote just on race. Many cities and small towns with majority black American populations have politicians of other races leading government.
Moreover, black Americans have found it quite easy to vote for white Americans such as Clinton, Gore and Carter.
When whites don't vote for black candidates is that racial?