合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
Class Info |
|---|
public class SearchFragment widget提供的SearchFragment类,继承自Fragment。 说明 正常使用SearchFragment需要调用setApiKey(String apiKey)方法设置API密钥。如果API密钥为空,点击搜索框则不会进行跳转。 |
Constructor Name |
|---|
SearchFragment() 默认的构造方法。 |
Qualifier and Type |
Method Name and Description |
|---|---|
void |
setApiKey(String apiKey) 设置SearchFragment的API密钥,必选。 |
void |
setHint(String hint) 设置搜索框的默认文本。 |
void |
setSearchFilter(SearchFilter filter) 设置搜索的限制条件。 |
void |
setOnSiteSelectedListener(SiteSelectionListener siteSelectedListener) 设置搜索结果列表项的侦听器。 |
Method |
|---|
public void setApiKey(String apiKey) 设置SearchFragment的API密钥,必选。 |
Parameters
Name |
Description |
|---|---|
apiKey |
设置API密钥。 |
Throws
Name |
Description |
|---|---|
IllegalArgumentException |
如果apiKey是null,抛出异常。 |
Method |
|---|
public void setHint(String hint) 您调用此API设置搜索框的默认文本。 |
Parameters
Name |
Description |
|---|---|
hint |
搜索框的默认文本。 |
Method |
|---|
public void setSearchFilter(SearchFilter filter) 您调用此API可以设置搜索的限制条件。 |
Parameters
Name |
Description |
|---|---|
filter |
SearchFilter对象,地点搜索的限制条件。 |
Method |
|---|
public void setOnSiteSelectedListener(SiteSelectionListener siteSelectedListener) 您调用此API可以设置搜索结果列表项的侦听器。 |
Parameters
Name |
Description |
|---|---|
siteSelectedListener |
SiteSelectionListener对象,搜索结果列表项的侦听器。 |