赞
踩
类似Toast设置显示时常,只能选择限定的值:LENGTH_SHORT或 LENGTH_LONG。
public static Toast makeText(Context context, CharSequence text, @Duration int duration) {
return makeText(context, null, text, duration);
}
自定义注解:
/**
* 添加物品时,区分类型
*/
@StringDef(value = [TYPE.VEHICLE_INSPECT, TYPE.PERSON_INSPECT])
@Retention(AnnotationRetention.SOURCE)
annotation class TYPE {
companion object {
const val VEHICLE_INSPECT: String = "2"//车辆核查
const val PERSON_INSPECT: String = "3"//人员核查
}
}
调用时:
fun start(mActivity: Activity, recordId: Int, personInfoList: MutableList<PersonInfo>?, @TYPE type: String) {}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。