Temperature can modulate how insects respond to environmental stressors, such as starvation. In this study, we examine whether and how the effects of temperature on starvation resistance depend on nutritional condition and developmental stages in Drosophila melanogaster. Starvation resistance decreased as the temperature exposed during starvation rose from 18 to 28 ̊C, which was mainly caused by warming-induced increase in energy expenditure. When exposed to warm temperatures during feeding, D. melanogaster accumulated more energy reserves and thus become more starvation resistant. The temperature experienced during the larval stage also had a significant effect on starvation resistance at adult stages, with those larvae raised at cold temperatures developing into adult phenotypes with reduced resistance to starvation. This study suggests that the effects of temperature on starvation resistance are highly complex and context dependent in D. melanogaster.