小编Jos*_*seF的帖子

Android/Gradle:根据构建类型有条件地应用插件

我想做一些像(伪代码)的东西:

if (BuildType == "release"){
    apply plugin: 'testfairy'
} else if (BuildType == "debug"){
    apply plugin: 'io.fabric'
}
Run Code Online (Sandbox Code Playgroud)

这个想法是基于构建类型,应用(或不应用)插件.怎么做 ?

android gradle build.gradle android-gradle-plugin gradle-plugin

13
推荐指数
2
解决办法
3578
查看次数

Intellij导航到letter-Mnemonic Bookmark快捷方式

导航到字母 - 助记书签的快捷方式是什么?

查看官方的Intellij文档,他们只是解释了数字助记书签的快捷方式.

PD:我很乐意添加Windows和Mac快捷方式.

intellij-idea android-studio intellij-13 intellij-12

8
推荐指数
1
解决办法
1748
查看次数

是否可以在Gerrit中编辑/更改/删除已发布的评论?

我在Gerrit中添加了评论并发布了它.我想在发布后编辑它.那可能吗?

gerrit

7
推荐指数
1
解决办法
3206
查看次数

Google语音操作:当Activity.isVoiceInteraction为true时?

内容

我正在尝试将Google语音操作集成我的应用中。我已经看过并理解了(或至少是我的想法)google codelabs-io2015示例,在此示例中,如果您不修改代码,一切都会按预期工作。当您尝试使此示例适应实际用例时,问题就开始了。

问题

所以,我的问题是我正在尝试实施搜索语音操作,但是Activity#isVoiceInteraction始终为false。我最终不了解该活动何时以及为何(以及何时未链接)到语音交互器。

研究

查看ActivityActivity#isVoiceInteractionActivity#getVoiceInteractor API级别23的源代码,发现以下内容:

 /**
 * Check whether this activity is running as part of a voice interaction with the user.
 * If true, it should perform its interaction with the user through the
 * {@link VoiceInteractor} returned by {@link #getVoiceInteractor}.
 */
public boolean isVoiceInteraction() {
    return mVoiceInteractor != null;
}
Run Code Online (Sandbox Code Playgroud)

/**
 * Retrieve …
Run Code Online (Sandbox Code Playgroud)

android google-voice-search google-voice-actions voice-interaction

5
推荐指数
0
解决办法
718
查看次数