QQ空间 新浪微博 腾讯微博 微信 更多
  

Activity + 基础UI

Activity + 基础UI

  1. 内容和考核要求



1 通过log或其他方式分析Activity的生命周期变化。测试场景要求覆盖:返回键退出后进入应用、home键退出进入应用、home键退出后切换字体后再次进入应用
2 AndroidManifest配置theme改变UI效果
3 界面包括:Button、EditText、TextView
4 输入文字,显示在TextView上
5 点击Button弹出对话框
6 点击Button跳转到其他Activity
7 通过显式Intent跳转
8 通过隐式Intent跳转
9 通过Intent传递数据到下一个Activity

一:

1. 返回键退出进入应用:

  1. 启动应用onCreate-onStart-onResume
  2. 按下返回onPuse- Onstope- onDestroy
  3. 重启启动onCreate-onStart-onResume

2. home键以后

  1. 启动应用onCreate-onStart-onResume
  2. Home键后onPuse-onStope
  3. onRestart-onStrat-onResume

3. home键退出切换字体

  1. 启动应用onCreate-onStart-onResume
  2. Home键后onPuse-onStope
  3. 调整字体生命周期无变化
  4. onDestroy,onCreat,onStart, onResume

二:AndroidManifest配置theme改变UI效果

三:UI

  1. Button弹出对话框,

  2. 跳转

    1. 隐式跳转其他Activity;
    2. 显式跳转其他Activity;
  3. Intent传递到下一个Activity

报错:

1 :

Android resource linking failed
C:\Users\S9023181\Documents\GitHub\daily3\app\src\main\res\menu\menu_main.xml:5: error: resource string/action_settings (aka com.example.daily3:string/action_settings) not found.
error: failed linking file resources.

解决:value中定义对应的值

2:Manifest标签除了<application以及内部,,其余均有闭合标签;

3:问题:打包,并在项目中引用了这个包,运行后,在手机上出现了两个相同的App图标。

    解决:打包时,把AndroidManifest.xml 文件中,以下内容都去掉。
<intent-filter>     <action android:name="android.intent.action.MAIN" />    <!--<action android:name="abc" />-->    <category android:name="android.intent.category.LAUNCHER" /></intent-filter>

实现代码TO:

posted @ 2019-07-18 21:07  nupt想象之中  阅读(412)  评论(0编辑  收藏  举报