需要应用程序启用索引样本code部分 [英] Need App Indexing enabled sample code part

查看:206
本文介绍了需要应用程序启用索引样本code部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序工作在App索引功能和之后的谷歌开发者指南。
指南我已经粘在下面。

I have working on App Indexing feature in my app and following the Google Developers guide. From the guide I have sticking on the following.

// Create App Indexing Link objects
AppIndexingLink item1 = new AppIndexingLink(appUri1, webUrl1, this.findViewById(R.id.btn1));
AppIndexingLink item2 = new AppIndexingLink(appUri2, webUrl2, this.findViewById(R.id.btn2)); 

从上面的语句,我们可以看到的参数。

From the above statements we can notice the parameters.

我对这个查询:


  1. 在文档他们提到该网页的网址是可选的。但是,当我删除,让编译错误,如果我让它空()给出NullPointerException异常(不知道空导致NullPointerException异常)

2,BTN1和BTN2,我们应该在哪里得到这些的?为什么我们有给他们? 。如果我给任何视图从我的项目产生NullPointerException异常(这是一个让我在第一个不能确定的情况)。

2.The btn1 and btn2, where should we get those from? Why we have give them there? . If I give any view from my project yields NullPointerException(This is the situation which makes me not sure on the first one).

如果任何一个有教程和样本codeS,以使应用程序索引,请提供。它可以帮助我们。

If any one have tutorial AND sample codes to enable the App Indexing , kindly provide it. Its may help us.

推荐答案

1,webUrl1是URI类型的对象,你需要解析某些URL前使用谷歌Play网址

1-webUrl1 is a object of Uri type you need to parse some url ex use your google play url

2 BTN1和BTN2可以任意查看用户正在观看例如图像视图或文本视图containign一些文本

2-btn1 and btn2 can be any view the user is viewing example a image view or a text view containign some text

这篇关于需要应用程序启用索引样本code部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆