Set Custom Theme Inherited From Built-in Android Theme

This example shows how you can set your own theme which is inherited from built-in themes in android.

Algorithm:

1.) Create a new project by File-> New -> Android Project name it CustomThemeExample.

2.) Write following into main.xml:

 

 

 

3.) Write following into your values/styles.xml:

 

 

4.) Write following into your manifest file:

 

 

 

5.) Run for output.

Steps:

1.) Create a project named CustomThemeExample and set the information as stated in the image.

Build Target: Android 4.4
Application Name: CustomThemeExample
Package Name: com.example.CustomThemeExample
Activity Name: CustomThemeExampleActivity

CustomThemeExample1

2.) Open CustomThemeExampleActivity.java file and write following code there:

 

 

3.) Compile and build the project.

Output

CustomThemeExample2