getCurrentItem
值为14但返回0.为什么返回0?我不明白。
如何在两个班级之间发送数据?
MainActivity.java
//this code return 0 but I get log retrun not 0
public int normal() {
Log.i("deneme",mFlippableStack.getCurrentItem()+ "");
//I/deneme: 14
return mFlippableStack.getCurrentItem();
}
ColorFragment.java
MainActivity abc = new MainActivity();
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(getContext(),""+abc.normal(), Toast.LENGTH_SHORT).show();
}
});