Apidemo首页文字流程
2015-03-07 21:33:37 2 举报
第一个作品,分析谷歌android中的apidemos入口activity
作者其他创作
大纲/内容
第一次进入?
为空代表这是第一次进入
yes
getData(path)
no
以前缀副本为前缀代表此activity属于此目录的子或孙文件
目标activity为自身
前缀是否为\"\"
创建一个前缀副本
遍历信息集合
否
return 空目录
前缀副本为空或标签是以前缀副本作为其前缀的
前缀副本追加斜杠
设置ListActivity的适配器
这是一个目录
是
是代表不是第一次进入
这是一个activity
将目录意图添加到书中
下一个标签作为显示的标题
开始
onCreat
将path置为\"\
添加这个activity意图到树中
创建一个用于储存数据的li集合
定义标签(如果为null则使用name属性为标签)
目录集合
前缀数组的长度比标签数组长度大1
目录树中是否已经包含这个下一标签
多数为在清单文件中设置的label属性
将该目录添加到目录树中
前缀数组置为null
创建一个main过滤器的activity的intent
下一个标签为分割后标签的第一个目录
获取意图
开启文本过滤?
将标签分割
获取其中的Path数据
代表还没有到达数的地步
只为保证程序健壮性
代表已经到达了树的根部
调用
判断path是否为null
获取标签
通过该initent查找包内所有符合该意图的activity
适配器
标签数组长度为1?
该结果集合是否为空
代表第一次进入
将前缀分割
下一个标签为分割后的标签的后一个目录
是否还需要循环
当点击条目时开启相应条目的意图
收藏
0 条评论
回复 删除
下一页