0

Briefly;

I'm working on a 'Device Production Test' project. We are developing system applications to test whether the API provided by the manifacturer is stable or not.

I need to set Android launcher application theme programmatically and check system level warnings and errors during this process. I see this question in SO but the source code link is broken.

How can I change Android theme programmatically?

Thanks in advance

Community
  • 1
  • 1
Burak Day
  • 907
  • 14
  • 28

2 Answers2

0

You can use this code in manifest file If you really want to launch the activity which I write.

<activity  
      android:name=".LaunchedActivityName"  
      android:label="@string/title_activity_main" >  
      <intent-filter>  
          <action android:name="android.intent.action.MAIN" />  
          <category android:name="android.intent.category.LAUNCHER"/>  
      </intent-filter>  
 </activity>  
0
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);

// set your custom theme here before setting layout
super.setTheme(android.R.style.Theme_Holo_Light_DarkActionBar);

setContentView(R.layout.activity_main);

overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
Shabbir Dhangot
  • 8,954
  • 10
  • 58
  • 80