问题标签 [extras]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2620 浏览

android - Android:putExtras 和 Intents

我在将字符串从片段传递到另一个活动时遇到问题。我已经尝试了许多使用意图传递它们的方法(例如正常的附加功能、捆绑包),但附加功能在活动中始终为空。

我看过

http://www.vogella.com/articles/AndroidIntent/但没有变化 http://developer.android.com/training/basics/firstapp/starting-activity.html 这种传递数据的方法也行不通

关于 stackoverflow 的其他类似问题 - 但这些并不完全相同

我要做的是获取在片段中的两个 EditText 中输入的文本,然后将该文本传递给其中两个 EditText 填充相同文本的活动。问题是活动中的两个 EditText 中没有出现任何内容。我知道片段中的 EditText 正在工作,因为可以使用它们创建通知。

我的代码:我删除了我认为不必要的东西,例如将片段添加到导航抽屉布局。请原谅缺少括号 - 我已经删除了很多代码,有些可能是不小心被删除的!:-)

这是我创建意图的片段:

这是我试图获得额外的活动

谢谢

0 投票
2 回答
415 浏览

java - 尝试捆绑附加:不兼容的操作数类型捆绑和字符串 & 方法 getIntent() 未为该类型定义

我正在尝试检查服务中的附加功能,但出现两个错误:

“不兼容的操作数类型 Bundle 和 String”就行了:

...和“方法 getIntent() 未定义类型”在行:

资源:

0 投票
3 回答
2841 浏览

android - 将 Intent Extras 传递给相同的活动 ANDROID 的问题

我正在尝试将意图附加信息传递给同一活动,但在单击页面时给出空指针异常。我试图采取额外的意图并使用它来确定要加载的布局文件。

Logcat 给出了一个

无法启动活动 ComponentInfo() java.lang.NullPointerException

按下按钮时。我对 Android 开发相当陌生,并且我在网上搜索过,但我找不到任何关于将 Intent Extras 传递回同一活动的信息。

也在清单中声明了此活动。

这是 logcat 错误:

任何援助将不胜感激。

谢谢,

0 投票
2 回答
92 浏览

java - 问题格式化服务中变量的初始化

上线报错:

说明:局部变量 mdn 可能尚未初始化

问题是如果我 Bundle extras = intent.getExtras(); 就在那条线上方,我最终得到一个“重复的局部变量附加”错误——如果我删除了 Bundle Extras 的第一个实例——我会得到更多这些相同的错误。我只需要一些帮助来格式化它,这样它就可以在没有任何错误的情况下执行。

非常感谢任何输入。

第一次编辑后的来源:

将 MDN 保存在 SharedPreferences 中的服务:

0 投票
1 回答
1334 浏览

java - 无法获得额外的();extra 无法解析或不是字段

我有点困惑 - 我得到了额外的东西:

然后我使用这些附加功能:

但我得到:

完整来源:

数据计数实用程序:

0 投票
2 回答
7454 浏览

log4j - org.apache.log4j.RollingFileAppender 和 org.apache.log4j.rolling.RollingFileAppender 的区别

有人能说出这件事有什么不同吗?此外,我不明白,如果 DailyRollingFileAppender 存在,为什么需要使用 TimeBasedRollingPolicy ?

0 投票
1 回答
3806 浏览

android - pass intent with extra to defined layout text view

I am at the beginning of an app, I'm an absolute amateur and what i want to do is simple. I am trying to pull Extras from an intent on my first activity into a textview on my second activity First page: what is your name? (type a name and push a button) On the next page: okay so your name is ...(the name they entered) I had an answer to this but had a little trouble understanding it, in the code i have, when i click the okay button just the word okay shows up in the textview rather than the edited text here is my code....

main.java

main.xml

secondactivity.java

activity_second.xml

androidmainfest.xml

can anyone tell me where I've gone wrong? Think its in my onCreate method on either Activity but really stuck, many thanks

0 投票
0 回答
440 浏览

jquery - jquery 数据表插件启用多种功能

jquery 数据表插件启用多种功能

jquery 数据表附加功能

嗨,我正在使用带有 ColVis 和 TableTools 附加功能的 DataTables jquery 插件。以下代码工作正常:

但是当我尝试添加额外的 ColReorder 时,所有插件都停止运行。我尝试使用以下代码在前面的代码中添加 R:

有任何想法吗?提前致谢。

0 投票
0 回答
27 浏览

java - 我可以找出数据对象中有多少额外内容吗?

我有一个带有一些复选框的活动,每个框都有一个添加到 ArrayList 的字符串值。单击 OK 按钮时,将创建一个 returnResult Intent,并将附加内容放入该 Intent。

在 onActivityResult 我想创建一个循环遍历数据对象的附加内容并将字符串添加在一起。

如何在数据对象中的位置 i 处获得额外信息?

0 投票
3 回答
1509 浏览

android - Start activity using intent with extra does not show all the extras

Inside a setOnItemClickListener I use an intent to start a new activity. I put 7 strings as extras for this intent. When I click an item (of a ListView) I want all these extras to be displayed (on a new screen). But I see only the first 4 extras. Here's the layout file for the new activity:

Then here's the listener code:

Here's the new activity code:

The problem is that it shows only the address, the city, the zip code, and the state. It does not show the name, store id and the phone number. What happens with them? Why they are not shown/seen on the new screen? Actually, before I added more extras, I could see all the extras in my intent. Is there a problem with the number of extras? Thanks for help, if you have an answer for me!