1.开发Activity步骤
第一步:写一个类继承Activity
第二步:重写oncreate方法
第三步:在主配置文件中注册Activity

<activity android:name=".类名"
android:label="@string/app_name">
<intent-filter>
<!-- app的入口>
<action android:name="android.intent.action.MAIN" />
<!-- 桌面显示>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

2.Activity 常用的方法
View findViewById (int id); //根据组建的ID取得组件对象
setContentView (int layoutResID); // 设置布局文件,设置显示组件

相关文章:

  • 2021-05-27
  • 2022-12-23
  • 2021-10-24
  • 2022-01-16
  • 2021-07-28
  • 2021-08-25
  • 2022-02-15
  • 2022-12-23
猜你喜欢
  • 2021-12-26
  • 2022-01-13
  • 2021-03-26
  • 2021-05-06
  • 2021-08-06
  • 2022-01-11
  • 2021-06-25
相关资源
相似解决方案