在 framework 中的那个 themes.xml 还有那个 styles.xml 

解决方案 »

  1.   

    theme里面有很多中 我要的是系统默认的那种!
      

  2.   

    默认的就是framework下的那个themes.xml
    theme是默认的,其他的都是类似继承了theme的,可供选择的
    当然应用也可以自己定义的
      

  3.   

    在 menifest.xml 文件中你可以设置默认的主题:
    <application
    android:theme="@android:style/Theme.Black"
    />
    你肯定是设置的android:theme="resource or theme"属性。请参考:http://developer.android.com/guide/topics/manifest/application-element.html 
      

  4.   

    framework下的那个themes.xml 里面 第一个 <style name="Theme">这个就是默认的。
    在ContextImpl.java文件getTheme()里可以看到
      if(mThemeResource == 0) {
         mThemeResource = com.android.internal.R.style.Theme;
      }
    应该是如果theme没有设置过,就给一个默认theme id。
     在PhoneWindowManager.java里也有设置默认theme的地方,也是同一个id;所以我觉得可以改一下<style name="Theme">的内容,或者把这个默认id换成com.android.internal.R.style.Theme_Light。不过Theme.Light比Theme少了很多内容,不知道直接换id会不会出问题。先说明,我只是看代码分析的,没试过,谁试试?
      

  5.   

    你看的是什么版本的代码?我这边看的是4.2的代码,已经没有你那个判断条件了,getTheme()方法内直接掉到Resource里面的selectDefaultTheme()方法里面,但是我改了哪些里面有几个theme ,我把它全部改成theme.holo.light,长按Power键出来的框还是黑底白字!
      

  6.   

    不过如果不设置theme,一个application会是theme.holo.light
      

  7.   

    你看的是什么版本的代码?我这边看的是4.2的代码,已经没有你那个判断条件了,getTheme()方法内直接掉到Resource里面的selectDefaultTheme()方法里面,但是我改了哪些里面有几个theme ,我把它全部改成theme.holo.light,长按Power键出来的框还是黑底白字!
    请问楼主解决了没阿?
      

  8.   

    在android 4.2上是在ActivityManagerService.java里面的main函数public static final Context main(int factoryTest) {
            AThread thr = new AThread();
            thr.start();        mEnableAppLaunchLog = checkAppLaunchLogTimeSetting(); /// M: It's for debugging App Launch time        synchronized (thr) {
                while (thr.mService == null) {
                    try {
                        thr.wait();
                    } catch (InterruptedException e) {
                    }
                }
            }        ActivityManagerService m = thr.mService;
            mSelf = m;
            ActivityThread at = ActivityThread.systemMain();
            mSystemThread = at;
            Context context = at.getSystemContext();
            context.setTheme(android.R.style.Theme_Holo_Light);
            Log.d("richard", "theme ... or what");
            m.mContext = context;
            m.mFactoryTest = factoryTest;
            m.mMainStack = new ActivityStack(m, context, true);
            
            m.mBatteryStatsService.publish(context);
            m.mUsageStatsService.publish(context);
            
            synchronized (thr) {
                thr.mReady = true;
                thr.notifyAll();
            }        m.startRunning(null, null, null, null);
            
            /// M: ANRManager Mechanism @{
            m.mANRManager = new ANRManager(m);
            m.mANRManager.startANRManager();
            m.mAnrDumpMgr = m.mANRManager.mAnrDumpMgr;
            m.mAnrHandler = m.mANRManager.mAnrHandler;
            /// @}
            return context;
        }
      

  9.   

    修改这个主题就OK了context.setTheme(android.R.style.Theme_Holo_Light);默认是Theme_Holo
      

  10.   

    ActivityThread里面有一个performLaunchActivity函数,这里会设置应用的默认主题,如果应用中有设置就用应用里面的,如果没有就用系统默认的。
    ActivityManagerService里面设置主题是给系统用的。
    PhoneWindowManager里面设置主题是给应用启动窗口用的。