小编Chi*_*hin的帖子

Android主题中的windowIsFloating属性

这个属性到底是做什么的?

我已经阅读了文档,我理解它应该是什么.但是,当我在主题中使用它时(我创建了一个带有android:Theme.Dialog父级的样式),更改此属性的值似乎没有任何效果.

android themes window

20
推荐指数
3
解决办法
1万
查看次数

带有API 21的TextToSpeech

有人可以帮我使用带有API 21的TTS.所有可用的示例都不推荐使用版本21

这是我的代码在最后一行给出错误:

Calendar cal = Calendar.getInstance();
                    cal.getTime();
                    SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
                    String text = sdf.toString();
                    btn.setText("Ouvir as Horas");

                    TextToSpeech tts = new TextToSpeech(NightClock.this,(TextToSpeech.OnInitListener) NightClock.this);
                    tts.setLanguage(Locale.US);
                    tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
Run Code Online (Sandbox Code Playgroud)

在Android开发人员中,它表示不推荐使用此方法,并将其替换为:

speak(String text,int queueMode,HashMap params)此方法在API级别21中已弃用.从API级别21开始,由speak(CharSequence,int,Bundle,String)取代.

有人可以帮我编写我的应用程序.

api android text-to-speech

18
推荐指数
4
解决办法
3万
查看次数

异步递归函数结束后的回调

下面的函数以递归方式在文件夹中打印Chrome书签.在处理完最终递归循环后,如何更改下面的函数来调用另一个函数?chrome.bookmarks.getChildren()是异步的,这使得很难知道函数何时完成处理所有内容.

谢谢.

    for (var i = 0; i < foldersArray.length; i++) {
        // The loop makes several calls with different folder IDs.
        printBookmarks(foldersArray[i]);  
    }

    // I'd like any code here to be run only after the above has 
    //finished processing    

    function printBookmarks(id) {
        chrome.bookmarks.getChildren(id, function(children) {
           children.forEach(function(bookmark) { 
               console.debug(bookmark.title);
               printBookmarks(bookmark.id);
           });
        });
    }
Run Code Online (Sandbox Code Playgroud)

编辑:对不起,我不认为我在初始代码示例中是清楚的.我已经更新了代码,通过多次调用函数来显示我对异步函数的问题.我想在printBookmarks函数调用之后的任何代码等待所有printBookmarks函数完成处理.

javascript recursion asynchronous callback

17
推荐指数
2
解决办法
2万
查看次数

模板参数中的const

const关键字在此模板中的作用是什么?

template <class T, int const ROWNUM, int const COLNUM> 
class Matrix
Run Code Online (Sandbox Code Playgroud)

这是否意味着此模板仅接受constas参数?如果是这样,有没有办法将变量作为COLNUMROWNUM

(当我尝试将变量作为模板的COLNUM传递时,它会出错:"IntelliSense:expression必须具有常量值")

c++ templates const

17
推荐指数
1
解决办法
2万
查看次数

为什么在添加片段时检查savedInstanceState == null?

在片段doc中,在其中一个示例中,他们检查savedInstanceState == null添加片段的时间:

public static class DetailsActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (getResources().getConfiguration().orientation
                == Configuration.ORIENTATION_LANDSCAPE) {
            // If the screen is now in landscape mode, we can show the
            // dialog in-line with the list so we don't need this activity.
            finish();
            return;
        }

        if (savedInstanceState == null) {
            // During initial setup, plug in the details fragment.
            DetailsFragment details = new DetailsFragment();
            details.setArguments(getIntent().getExtras());
            getFragmentManager().beginTransaction().add(android.R.id.content, details).commit();
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这项检查的目的是什么?如果它不存在会发生什么?

android android-fragments

17
推荐指数
1
解决办法
8100
查看次数

WRAP_CONTENT视图中的MATCH_PARENT视图

我理解这MATCH_PARENT意味着View希望与其父级一样大(减去填充),并且WRAP_CONTENT意味着View想要足够大以封闭其内容(加上填充)

我的问题是,当MATCH_PARENT视图(视图A)放在WRAP_CONTENT视图(视图B)中时会发生什么?在这种情况下,如何计算两个视图A和B的参数?

android android-layout

14
推荐指数
1
解决办法
3021
查看次数

Visual Studio Text Visualizer缺少文本

我正在使用Text Visualizer在Visual Studio中调试字符串变量.但是,似乎缺少字符串中间的大部分内容.这背后的原因是什么?

在此输入图像描述

visual-studio-2015

14
推荐指数
1
解决办法
2204
查看次数

WindowBuilder Pro是否已安装在Eclipse中?

在此页面:https://developers.google.com/java-dev-tools/download-wbpro,没有选项可以将WindowBuilder Pro安装到Eclipse Juno(4.2).

Window Junilder是否已经安装了Eclipse Juno?

另外,WindowBuilder Pro有更好的免费替代方案吗?

java eclipse gui-designer windowbuilder

13
推荐指数
1
解决办法
3万
查看次数

Git合并订单的差异?

两者之间有什么区别吗?

git merge c1 c2
Run Code Online (Sandbox Code Playgroud)

git merge c2 c1
Run Code Online (Sandbox Code Playgroud)

?另外,两者之间有什么区别

git checkout c1
git merge c2
Run Code Online (Sandbox Code Playgroud)

git checkout c2
git merge c1
Run Code Online (Sandbox Code Playgroud)

git

13
推荐指数
1
解决办法
2839
查看次数

对Travis和其他CI服务进行浅层克隆的缺点是什么?

大多数CI服务提供了一种浅层克隆存储库的方法.例如,在特拉维斯:

git:
  depth: 1
Run Code Online (Sandbox Code Playgroud)

或者在AppVeyor上:

clone_depth: 1
or
shallow_clone: true
Run Code Online (Sandbox Code Playgroud)

这有明显的速度优势,因为您不必克隆整个存储库.

CI服务的浅层克隆是否有任何缺点?是否存在浅层克隆会导致CI构建失败的情况?否则,为什么不浅层克隆这些CI服务的默认设置?

git continuous-integration travis-ci shallow-clone appveyor

12
推荐指数
3
解决办法
2046
查看次数