Code Monkey home page Code Monkey logo

Comments (4)

zhanghai avatar zhanghai commented on August 15, 2024

AddAccountActivity 是为了在 MainActivity 中调用 AccountUtils.ensureAccountAvailability() 无活动账户时 finish 掉 MainActivity 后保持一个前台 Activty,然后在 AccountManager 返回后重新启动被 finish 的原 Activity(这里是 MainActivity)并 finish 自身。

from douya.

dumingxin avatar dumingxin commented on August 15, 2024

感谢回复!
现在的流程应该是MainAcitvity启动AddAccountActivity然后finish,AddAccountActivity调用AccountManager的addAccount方法之后会启动登录的那个Activity,登录成功之后执行AddAcountActivity定义的回调,回调中finish掉AddAcountActivity,然后重新启动MainActivity。
如果我不经过AddAccountActivity,直接在AccountUtil中调用AccountManager的addAccount方法,然后在回调中finish掉原来的MainActivity再重新启动一个MainActivity可不可以

from douya.

zhanghai avatar zhanghai commented on August 15, 2024

这样的话原来的 MainActivity 的 Lifecycle 方法会在没有活动账户的情况下被继续调用,但如果你不在乎的话应该是可以的

from douya.

dumingxin avatar dumingxin commented on August 15, 2024

这个没想到,没有活动账户的情况下继续执行MainActivity的方法不合适,还是你的处理方式好

from douya.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.