android studio 创建第一个app之hello world
想要用studio创建一个简单的app,结果遇到各种问题,application就是允许不起来,后来在专业人的帮助下,删除了一些文件,然后运行起来了。
先看效果:
开发代码
1 package com.demo.my.myapplication; 2 3 import android.support.annotation.Nullable; 4 import android.support.v7.app.AppCompatActivity; 5 import android.os.Bundle; 6 7 public class MainActivity extends AppCompatActivity { 8 9 @Override 10 protected void onCreate(@Nullable Bundle savedInstanceState) { 11 super.onCreate(savedInstanceState); 12 setContentView(R.layout.activity_main); 13 } 14 }
改变颜色配置
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<!--默认颜色
<item name="colorPrimary">@android:color/background_dark</item>
<item name="colorPrimaryDark">@android:color/background_light</item>
<item name="colorAccent">@android:color/darker_gray</item>
-->
<!-- 修改页面颜色. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowNoTitle">true</item>
</style>
<style name="Theme.Light.NoTitleBar" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowIsTranslucent">true</item>
</style>
</resources>