java.lang.NullPointerException:尝试在空对象引用上调用虚方法'int android.widget.LinearLayout.getLeft()'

时间:2017-06-24 13:38:08

标签: android nullpointerexception

当我尝试实施循环显示效果时,我收到此错误 有没有人有想法?

private void ChooseFile() {

    int cx = (mRevealView.getLeft() + mRevealView.getRight());
        int cy = (mRevealView.getTop() + mRevealView.getBottom())/2;
   // int cy = mRevealView.getTop();

    int radius = Math.max(mRevealView.getWidth(), mRevealView.getHeight());

1 个答案:

答案 0 :(得分:0)

mRevealView不存在。确保将mRevealView设置为值