如何从另外一个 activity 中编辑一个按钮?
它返回的是:
java.lang.IllegalStateException: Could not execute method of the activity
Caused by: java.lang.NullPointerException
但是我想在 Button getButton = (Button)findViewById(R.id.buttonGet);
获取 getButton.setEnabled(false);
。
如何实现?
确保在按钮获取一个引用时,要调用 setContentView:
在Button getButton = (Button)findViewById(R.id.buttonGet);
代码之前设置:
setContentView(R.layout.my_activity_layout);
可以用传递handle,然后send message去更新ui