深圳全飞鸿

标题: empty activity [打印本页]

作者: admin    时间: 2019-5-22 14:05
标题: empty activity
  1. package com.example.administrator.myapplication3;

  2. import android.support.v7.app.AppCompatActivity;
  3. import android.os.Bundle;

  4. public class MainActivity extends AppCompatActivity {

  5.     @Override
  6.     protected void onCreate(Bundle savedInstanceState) {
  7.         super.onCreate(savedInstanceState);
  8.         setContentView(R.layout.activity_main);
  9.     }
  10. }
复制代码

作者: admin    时间: 2019-5-22 14:07
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3.     package="com.example.administrator.myapplication3">

  4.     <application
  5.         android:allowBackup="true"
  6.         android:icon="@mipmap/ic_launcher"
  7.         android:label="@string/app_name"
  8.         android:roundIcon="@mipmap/ic_launcher_round"
  9.         android:supportsRtl="true"
  10.         android:theme="@style/AppTheme">
  11.         <activity android:name=".MainActivity">
  12.             <intent-filter>
  13.                 <action android:name="android.intent.action.MAIN" />

  14.                 <category android:name="android.intent.category.LAUNCHER" />
  15.             </intent-filter>
  16.         </activity>
  17.     </application>

  18. </manifest>
复制代码

作者: admin    时间: 2019-5-22 14:08
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.     xmlns:app="http://schemas.android.com/apk/res-auto"
  4.     xmlns:tools="http://schemas.android.com/tools"
  5.     android:layout_width="match_parent"
  6.     android:layout_height="match_parent"
  7.     tools:context="com.example.administrator.myapplication3.MainActivity">

  8.     <TextView
  9.         android:layout_width="wrap_content"
  10.         android:layout_height="wrap_content"
  11.         android:text="Hello World!"
  12.         app:layout_constraintBottom_toBottomOf="parent"
  13.         app:layout_constraintLeft_toLeftOf="parent"
  14.         app:layout_constraintRight_toRightOf="parent"
  15.         app:layout_constraintTop_toTopOf="parent" />

  16. </android.support.constraint.ConstraintLayout>
复制代码

作者: admin    时间: 2019-5-22 14:12
values 目录下:

colors.xml


  1. <?xml version="1.0" encoding="utf-8"?>
  2. <resources>
  3. <color name="colorPrimary">#3F51B5</color>
  4. <color name="colorPrimaryDark">#303F9F</color>
  5. <color name="colorAccent">#FF4081</color>
  6. </resources>
复制代码






strings.xml

  1. <resources>
  2.     <string name="app_name">My Application3</string>
  3. </resources>
复制代码




styles.xml

  1. <resources>

  2.     <!-- Base application theme. -->
  3.     <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
  4.         <!-- Customize your theme here. -->
  5.         <item name="colorPrimary">@color/colorPrimary</item>
  6.         <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
  7.         <item name="colorAccent">@color/colorAccent</item>
  8.     </style>

  9. </resources>
复制代码







欢迎光临 深圳全飞鸿 (http://www.nagomes.com/disc/) Powered by Discuz! X3.2