赞
踩
最开始提到了Launcher选择弹窗,我们就考虑在这里做点事,把弹窗的逻辑给跳过,就可以实现默认启动。
弹窗源码位于frameworks/base/core/java/com/android/internal/app/ResolverActivity.java
在这里就不具体分析源码了,就看关键部分
public boolean configureContentView(List payloadIntents, Intent[] initialIntents,
List rList, boolean alwaysUseOption) {
// The last argument of createAdapter is whether to do special handling
// of the last used choice to highlight it in the list. We need to always
// turn this off when running under voice interaction, since it results in
// a more complicated UI that the current voice interaction flow is not able
// to handle.
mAdapter = createAdapter(this, payloadIntents, initialIntents, rList,
mLaunchedFromUid, alwaysUseOption && !isVoiceInteraction());
final int layoutId;
if (mAdapter.hasFilteredItem()) {
layoutId = R.layout.resolver_list_w
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。