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
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- [Android学习之路]-Activity的启动方式
- Android基础控件——TextView的跑马灯效果、变量赋值、字体属性、超链接、Activity跳转、字体加粗、自定义字体
- android中activity详解
- Android静态安全检测 -> Activity组件暴露
- Android中调用另外的Activity
- Android四大组件之一:Activity总结(上)
- Android开机启动Activity或者Service方法
- Android Fragment IllegalStateException: Fragment not attached to Activity
- Android之ListActivity 布局与数据绑定
- Android activity的生命周期
- Android 官方文档之Activity和Task
- 第二篇:Android四大组件之Activity的认识与使用
- Android_View,ViewGroup,Window之间的关系 android activity,intent,service是什么关系?
- Android——自定义AlertDialog并与Activity进行数据通信
- Android开发之---两个Activity之间利用广播机制更新数据
- android不依赖具体activity弹出Dialog对话框,即全局性对话框 (
- android 横竖屏切换时的activity生命周期
- Android之四大组件之一-Activity(一)
- android:activity最简单的侧滑效果
- Android Studio之多个Activity的滑动切换(二)