首页新闻找找看学习计划

Android的AutoCompleteTextView在API17高版本添加的setText函数在低版本系统居然能正常调用?官方文档是不

0
悬赏园豆:50 [已关闭问题] 关闭于 2015-04-30 13:17

官方文档:https://developer.android.com/reference/android/widget/AutoCompleteTextView.html#setText(java.lang.CharSequence, boolean)

 

public void setText (CharSequence text, boolean filter)

Added in API level 17

Like setText(CharSequence), except that it can disable filtering.

Parameters

filter If false, no filtering will be performed as a result of this call.

//官方文档标注为API.17才添加:public void setText(CharSequence text, boolean filter)
//Android Lint 是会检测到错误的!
//但是经过实际的机器测试中兴U880的2.2系统API8居然运行一切正常!很奇葩!
//为了以防万一,还是做一下异常处理

try
{
this.mCuurentView.setText(“something”, false);
}
catch (final Exception ex)
{
LogEx.e("setText(CharSequence text, boolean filter)果然报错了!", ex);

}

Asion Tang的主页 Asion Tang | 初学一级 | 园豆:200
提问于:2015-04-27 19:39
< >
分享
所有回答(1)
0

http://stackoverflow.com/questions/29894904/why-high-api-level-added-method-autocompletetextview-settextcharsequence-boole/29958789#29958789

Asion Tang | 园豆:200 (初学一级) | 2015-04-30 13:17
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册