In the interpretation of dreams in Islam, the earthquake is a threat by the ruler. If one sees the earth caving in under him, he will suffer a severe chastisement. An earthquake in dream usually means a bitter illness or a plague hitting the population of the town or ocusts or a severe cold weather, or it could mean a drought.
If an evil person sees the earth caving under him in a dream, it means a punishment for his sins or undertaking a long and a distant journey from which he may not return home. Unlike other symbols, the dream of earthquake is always global rather than individual. It's important to make a lot of Sadaka when you dream about earthquake and it's better to do it the same day or the day after the dream.