Closed Foreverpassenger closed 7 years ago
MainActivity:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent( MainActivity.this, SecondActivity.class); startActivity(intent); } }); }
SecondActivity:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_second); String ing = null; Log.d("logggg", ing.length() + ""); Button button = (Button) findViewById(R.id.btn); button.setText("hellosdfsfa"); }
这个黑屏是由于什么原因导致的呢,请教下
因为activity没初始化结束所以导致了生命周期不完整,所以就出现了问题,Cockroach适合于由于服务端返回数据问题导致的crash,以及listview等这种延时加载view的控件,以及点击控件时导致的crash
MainActivity:
SecondActivity:
这个黑屏是由于什么原因导致的呢,请教下