接口定义的步骤

1: 创建接口

public interface ChangedListener {

/**
     * ......接口 return 0 :关闭 ,1 :打开
     * */
    void onFFChange(final int fullSizeIndex);

}

2:绑定接口并监听

mCameraSettingAdapte = new CameraSettingAdapte(this);

mCameraSettingAdapte.addChangeListener(new CameraSettingChange());


class CameraSettingChange implements CameraSettingChangedListener {

        @Override
        public void onCameraSettingFullSizeChange(int fullSizeIndex) {
            // TODO Auto-generated method stub
            Log.e("接口   cs ", " 。。。接口   " + fullSizeIndex);
        }

}

3:实例化接口

private CameraSettingChangedListener mCameraSettingChangedListener = null;

//CameraSettingChange中

public void addChangeListener(CameraSettingChangedListener listener) {
        mCameraSettingChangedListener = listener;
    }


mCameraSettingChangedListener
                    .onCameraSettingImageConfirmedTimeChange(0);





你可能感兴趣的:(Class,interface)