1. Animals often have to choose between multiple food sources in their habitat, and these potentially complex decisions have a large impact on their fitness. Among other factors, previous experience with an alternative resource can significantly increase subsequent preference for the resource ('induction of preference').2. Induction of resource preference is particularly relevant in spatially or temporally heterogeneous habitats. Although most mobile species -especially generalists -probably frequently encounter habitat heterogeneity, the impact of preference induction on individual behaviour and fitness in heterogeneous habitats is poorly understood. This study analysed larval preference induction in wheat-adapted generalist red flour beetles, Tribolium castaneum (Coleoptera: Tenebrionidae), under three types of habitat heterogeneity.3. First, the induction of preference for novel cereal flours under temporal heterogeneity was analysed, exposing larvae to new resources during development. Larvae preferred a new resource if they experienced it recently, but the magnitude of induction varied across resources.4. Specific induction for a homogenous mix of wheat and a novel resource was also observed, with larvae preferring the mix over either pure resource.5. To analyse induction under spatial heterogeneity, beetle eggs were placed in one of two alternative resource patches and the preference of emerged larvae was tested. Hatching into a novel resource did not always induce preference.6. Finally, it was found that induction of preference for new resources could be maladaptive for larval development. In sum, this work demonstrates that experience-based plasticity of larval resource choice may strongly impact larval preference and fitness in heterogeneous habitats.