【问题标题】:Nativescript - android Intent code not workingNativescript - android Intent 代码不起作用
【发布时间】:2017-01-10 20:38:47
【问题描述】:

我有一个带有 Android 特定调用的 {N} 应用。

intent.putExtra("变量", 123);

看起来 {N} 正在使用 putExtra(String,double) 重载。

如何强制它使用 putExtra(String,int) 重载。

谢谢。

【问题讨论】:

    标签: nativescript


    【解决方案1】:

    您可以使用本机代码中的java.lang.Integer

    intent.putExtra( "variable", new java.lang.Integer(123) );
    

    【讨论】:

    • 其实看了docs之后,{N}默认将一个数字解释为一个int。问题是别的 - 但我很感激你的回答。
    • 我在图表插件中遇到了这个问题,所以我也使用 java.lang.Integer 来强制 int :)
    猜你喜欢
    • 1970-01-01
    • 2021-10-10
    • 2019-07-27
    • 1970-01-01
    • 2017-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多