您的位置:首页 > 移动开发 > Android开发

Android-Activity

2020-01-15 11:34 1606 查看
1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3     package="com.hanqi.myapplication">
4
5     <application
6         android:allowBackup="true"
7         android:icon="@mipmap/ic_launcher"
8         android:label="@string/app_name"
9         android:supportsRtl="true"
10         android:theme="@style/AppTheme">
11
12         <activity
13             android:name=".TestActivity1">
14             <intent-filter>
15                 <action android:name="android.intent.action.MAIN"/>
16                     <category android:name="android.intent.category.LAUNCHER"/>
17             </intent-filter>
18         </activity>
19 </application>
20 <manifest/>
 


 

1 package com.hanqi.myapplication;
2
3 import android.app.Activity;
4 import android.os.Bundle;
5 //1.继承Activity
6 /**
7  * Created by Administrator on 2016/04/22.
8  */
9 public class TestActivity1 extends Activity{
10
11     //2.重写onCreate(),关联layout文件
12         //onCreate()回调方法:在满足特定条件下自动调用的方法;方法名一般On开头
13
14     @Override
15     protected void onCreate(Bundle savedInstanceState) {
16         super.onCreate(savedInstanceState); //右键单击覆盖方法选择onCreate方法.
17         //关联
18         setContentView(R.layout.message_linearlayout);
19     }
20 }

 

转载于:https://www.cnblogs.com/TENOKAWA/p/5422489.html

  • 点赞
  • 收藏
  • 分享
  • 文章举报
banglun5623 发布了0 篇原创文章 · 获赞 0 · 访问量 200 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: