This paper proposes a new method to determine the viability of a switched system on a cone and an unbounded polyhedron. First, we investigate the viability condition on a cone. Then, a sufficient viability criterion for a polyhedron, which is expressed by a convex hull of finite number of extreme points and a nonnegative linear combination of finite extreme directions, is presented by using nonsmooth analysis. Based on this criterion, instead of all boundary points, just several extreme points and extreme directions are needed to be verified whether satisfying some conditions. The advantage of the proposed methods is that determining the viability for a switched system is easy to be implemented. Finally, an example is listed to illustrate the effectiveness of the proposed methods.