Comments (4)
AddAccountActivity 是为了在 MainActivity 中调用 AccountUtils.ensureAccountAvailability() 无活动账户时 finish 掉 MainActivity 后保持一个前台 Activty,然后在 AccountManager 返回后重新启动被 finish 的原 Activity(这里是 MainActivity)并 finish 自身。
from douya.
感谢回复!
现在的流程应该是MainAcitvity启动AddAccountActivity然后finish,AddAccountActivity调用AccountManager的addAccount方法之后会启动登录的那个Activity,登录成功之后执行AddAcountActivity定义的回调,回调中finish掉AddAcountActivity,然后重新启动MainActivity。
如果我不经过AddAccountActivity,直接在AccountUtil中调用AccountManager的addAccount方法,然后在回调中finish掉原来的MainActivity再重新启动一个MainActivity可不可以
from douya.
这样的话原来的 MainActivity 的 Lifecycle 方法会在没有活动账户的情况下被继续调用,但如果你不在乎的话应该是可以的
from douya.
这个没想到,没有活动账户的情况下继续执行MainActivity的方法不合适,还是你的处理方式好
from douya.
Related Issues (20)
- 缺少部分关键类,下载了两次还是同样情况,麻烦告知下 HOT 1
- 手机版网页链接无法识别
- Feature Request: 使用正则表达式屏蔽特定广播 HOT 3
- Remove 140 character limit when sending broadcast
- 怎么在模拟器上调试? HOT 1
- 有个文件名太长,给电脑使用带来麻烦 HOT 3
- emui安卓9报该应用感染病毒 HOT 5
- Include BlobEmoji
- 登录后无法看到内容 HOT 1
- Api签名加密算法的问题 HOT 3
- 关于API签名验证的问题 HOT 1
- 不再更新release了吗 HOT 1
- F-Droid HOT 2
- 升级到 Glide 4.2+
- 发广播界面发送时未禁用底部按钮 HOT 1
- 账号锁定 HOT 1
- 标记游戏页面缺少平台
- 书页面缺少详细的作者和译者信息
- Android Studio 3.0 打开出错 HOT 1
- 代码没有注释,实在没看懂frodo.douban.com的请求是怎么计算_sig参数的 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from douya.