Habitat destruction and land use change are making the world in which natural populations live increasingly fragmented, often leading to local extinctions. Although local populations might undergo extinction, a metapopulation may still be viable as long as patches of suitable habitat are connected by dispersal, so that empty patches can be recolonized. Thus far, metapopulations models have either taken a mean-field approach, or have modeled empirically-based, realistic landscapes. Here we show that an intermediate level of complexity between these two extremes is to consider random landscapes, in which the patches of suitable habitat are randomly arranged in an area (or volume). Using methods borrowed from the mathematics of Random Geometric Graphs and Euclidean Random Matrices, we derive a simple, analytic criterion for the persistence of the metapopulation in random fragmented landscapes. Our results show how the density of patches, the variability in their value, the shape of the dispersal kernel, and the dimensionality of the landscape all contribute to determining the fate of the metapopulation. Using this framework, we derive sufficient conditions for the population to be spatially localized, such that spatially confined clusters of patches act as a source of dispersal for the whole landscape. Finally, we show that a regular arrangement of the patches is always detrimental for persistence, compared to the random arrangement of the patches. Given the strong parallel between metapopulation models and contact processes, our results are also applicable to models of disease spread on spatial networks. 