首页
Activity默认的启动模式是singleTop模式
精华吧
→
答案
→
慕课
→
未分类
Activity默认的启动模式是singleTop模式
A.正确
B.错误
正确答案:错误
Tag:
Android开发
模式
时间:2022-01-14 14:36:56
上一篇:
Intent可以用来开启Activity,同样它也可以用来在Activity之间传递数据。
下一篇:
在数据传递时,如果需要获取返回的数据,需要使用onActivityResult()方法。
相关答案
1.
Activity是Android应用程序的四大组件之一。
2.
Activity在AndroidManifest.xml文件中进行注册后就不能进行修改了。
3.
Activity不是Context的子类。
4.
通常一个应用程序对应一个任务栈,默认情况下每启动一个Activity都会入栈,并处于栈顶位置。
5.
Android中Intent传递类对象提供了两种方式一种是通过实现Serializable接口传递对象,一种是通过实现Parcelable接口传递对象。
6.
当Activity处于运行状态时,Android会尽可能地保持它的运行,即使出现内存不足的情况,Android也会先杀死栈底部的Activity,来确保可见的Activity正常运行。
7.
使用Intent不能传递Parcelable类型的对象。
8.
Activity在运行状态时处于屏幕最前端,它是可见、有焦点的,可以与用户进行交互。
9.
当用startActivityForResult启动activityB时,可以在onActivityResult方法接收activityB回传的数据。
10.
使用AndroidStudio创建Activity时,会在AndroidManifest.xml文件中自动进行注册。
热门答案
1.
standard是Activity默认的启动模式,在不指定Activity启动模式的情况下,所有Activity使用的都是standard这种模式。
2.
在目标Activity中,通常使用setResult方法设置返回数据。
3.
显示意图,即启动Activity时不需要指定Activity的名称。
4.
Activity可以不用在AndroidManifest.xml文件中注册就可以运行。
5.
当Activity处于销毁状态时,将被清理出内存。
6.
Activity的生命周期分为五种状态,分别是启动状态、运行状态、暂停状态、停止状态和销毁状态。
7.
使用Intent传递数据时,可以使用putExtra方法把参数封装到Intent中。
8.
singleTop和standard一样,不过如果该Activity类的实例在栈顶的话,就直接复用已有的Activity示例,并不再创建新的实例。
9.
Standard启动activity都会创建一个新的Activity,即使有一个该Activity类实例在栈顶,它还是会创建一个新的Activity,压入栈中。
10.
Activity中有四种加载模式:standard,singleTop,singleTask,singleInstance。