我有一个int名为 的变量mCurrentIndex。当它的值发生变化时我想做一些事情。
例如:
public class MainActivity extends Activity{
private int mCurrentIndex = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Apps logic.
}
public onCurrentIndexValueChange(){
button.setClickable(true);
}
}
Run Code Online (Sandbox Code Playgroud)