我开始为Android开发应用程序。我在Eclipse中编写了一些代码,并使用附加的仿真器。当我发送程序到我的模拟器时,我得到了一些错误。
调试器在行super.onCreate(savedInstanceState); // savedInstanceState = null中显示
我的代码
public class PushAndroidActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
try
{
super.onCreate(savedInstanceState);
checkNotNull(SENDER_ID, "SENDER_ID");发布于 2013-02-06 18:46:08
你能不能试着旋转你的设备--左ctrl F11。您将意识到该包是!= null
如果视图有id,则默认情况下将为其调用onSaveInstanceState()。默认实现通过在层次结构中具有id的每个视图上调用onSaveInstanceState()来为您处理大部分UI每个实例的状态。您可以检查以下内容:
savedInstanceState is always null
When are ALL the cases when the onSaveInstanceState() method called?
https://stackoverflow.com/questions/14726876
复制相似问题