1、AppCompatActivity继承自FragmentActivity。所以在导致使用Theme中有一些问题。
2、使用的项目架构正好又是titile ,liearlayout add的心得View。
3、解决办法
//gw: 不行,很多layout里有自定义布局,所需的context都必须是Activity而非Application,崩崩崩~
Context ctxWithTheme = new ContextThemeWrapper( getBaseContext() , R.style.AppTheme);
LayoutInflater localLayoutInflater = LayoutInflater.from(getBaseContext()).cloneInContext (ctxWithTheme);
contentView = localLayoutInflater.inflate(contentResID , null);
4、这样又导致,android.support.v7.view.ContextThemeWrapper cannot be cast to android.app.Activity 。
5、所以依然没有解决
6、在以后使用Theme需要先入为主的方式。