In opportunistic mobile social networks, nodes are clustered according to their interests or hobbies and take part in different activities regularly. We delve into the temporal and spatial mobility characteristics of network nodes and put forward an activity-based message opportunistic forwarding algorithm. The main idea of the algorithm is that we choose different message forwarding methods according to the situation of nodes participating in activities. If the source node and the destination node are both attend in the same activities, we select the best relay node which has the biggest delivery probability. While the source node and the destination node are not in the same activities at the same time, we need to find the optimal path which owns highest indirect delivery probability, and messages will be transmitted through the optimal path. The simulation results show that the proposed routing algorithm can not only improve the successful delivery ratio of messages but also reduce the network delay and the network overhead obviously, in comparison with the classical opportunistic routing algorithms, such as community-aware message opportunistic transmission algorithm, community-based message transmission scheme algorithm, PRoPHET, Epidemic algorithm, and interest characteristic probability prediction algorithm.