When an application if you do not set up their own theme and they will call the system default theme, the current default theme android black background and white text color, people know that the default theme is an android project which set out to do ?
Reply:
Yes! ! Information

Reply:
Do you know?
Reply:
In the framework of the themes.xml And that styles.xml
Reply:
There are a lot of theme I want is the kind of system default!
Reply:
If you change the theme of the whole project is to give the words
As shown:
Is a change in the configuration file!
Reply:
The default is that themes.xml
framework undertheme is the default, the other is similar to the theme of inheritance, to choose
Of course, applications can also define your own
Reply:
In menifest.xml file you can set the default theme:
& lt; application
android: theme = "@ android: style / Theme.Black"
/ & Gt;
You must be set android: theme = "resource or theme" attribute.
Refer to: http://developer.android.com/guide/topics/ manifest / application-element.html
Reply:

Reply:
themes.xml framework under which the first & lt; style name = "Theme" & gt; This is the default.
In ContextImpl.java file getTheme () where you can see
if (mThemeResource == 0) {
mThemeResource = com.android.internal.R.style.Theme;
}
It should be if the theme was not set, give a default theme id.
In PhoneWindowManager.java also has set up local default theme, it is the same id;
So I think we can change what & lt; style name = "Theme" & gt; content, or to replace the default id com.android.internal.R.style.Theme_Light. However Theme.Light Theme less than a lot of content, I do not know directly for id will not be a problem.
First explain, I just look at the code analysis, have not tried, who try?
Reply:
You see what version of the code? I see here is the 4.2 code, you have no conditions that the judge, fell directly within getTheme () method Resource inside selectDefaultTheme () method inside, but I changed which there are several theme, I put it all into theme.holo.light, long press Power key out of the box or black and white!
Reply:
But if you do not set the theme, an application will be theme.holo.light
Reply:
Will the landlord did not solve the Arab-Israeli?
Reply:
On android 4.2 is inside the main function in ActivityManagerService.java
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;
} Reply:
Modify this topic on the OK context.setTheme (android.R.style.Theme_Holo_Light); default is Theme_Holo
Reply:
ActivityThread which has a performLaunchActivity function, where the theme will set the default application, if the application has set up on the inside with the application, if not to use the system default.
ActivityManagerService which set the theme for the system used.
PhoneWindowManager which set the theme for application launch window used.
Reply:
Landlord solved? I now want to know the system refers to the default theme code in the piece, as well as appearing at the position, is set in a place it?
No comments:
Post a Comment