Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用代码调用可运行的活动
Mover simulationRuntime = new Mover();
onCreate()不运行什么给出?
onCreate()
这是开始活动的错误方式。您应该使用startActivityGoogle 为您提供的方法
startActivity
onCreate仅在框架实例化活动时由框架调用。要从您的代码开始另一个活动,请创建一个Intent然后使用startActivity.
onCreate
Intent
当您在代码示例中创建Mover对象时,只会运行构造函数。
Mover