我这样做是为了创建一个意图。
Intent notificationIntent = new Intent(this, Startup.class);
notificationIntent.putExtra("url", contentUrl);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
Notification notification = new Notification(icon, tickerText, when);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
Run Code Online (Sandbox Code Playgroud)
得到额外的钱后,
CharSequence url = this.getIntent().getCharSequenceExtra("url");
Run Code Online (Sandbox Code Playgroud)
有许多 Intent 及其各自的 url 值。但我也在 Startup 类的 onCreate() 中得到了相同的值。
我做错了什么?
正在生成 bundle.js 文件,但不在 webpack.configure.json 中指定的文件夹中(具体放入哪个文件夹和路径,不清楚)浏览器显示正确的输出。没有错误。我已经从命令提示符安装了以下内容(对于 Windows)
我希望看到在 sample3 文件夹中创建的 bundle.js 文件,但在执行命令 webpack-dev-server 后它不在那里
webpack.configure.json 文件如下
module.exports = {
entry: "./app.js",
output: {
filename: "bundle.js"
}
}
Run Code Online (Sandbox Code Playgroud)
下面给出了 package.json 文件
{
"name": "sample3",
"version": "1.0.0",
"description": "reactjs sample application",
"main": "app.js",
"scripts": {
"start": "webpack-dev-server --hot" },
"keywords": [
"reactjs"
],
"author": "abc", …Run Code Online (Sandbox Code Playgroud) 当我关闭/最小化我的应用程序时,我遇到了 TransactionTooLargeException。我假设这是由于我的 Bundle 太大(3 个 JSONArrays 作为字符串),但是如果有人可以从我的错误跟踪中诊断出更多信息,那就太好了。
这里是:
05-28 17:17:25.994 9518-9518/com.adamtrudeauarcaro.godbuilder E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 551100)
05-28 17:17:25.996 9518-9518/com.adamtrudeauarcaro.godbuilder D/AndroidRuntime: Shutting down VM
05-28 17:17:25.998 9518-9518/com.adamtrudeauarcaro.godbuilder E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.package.godbuilder, PID: 9518
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 551100 bytes
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:4211)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6688)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: android.os.TransactionTooLargeException: data parcel size 551100 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:628)
at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:4132)
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:4203) …Run Code Online (Sandbox Code Playgroud) 我尝试运行我的项目,但出现以下错误:捆绑失败:
Error: Unable to resolve module `./$.html` from `/Safee/sf-code/sf-safee-clients/sf-client-mobile/node_modules/core-js/modules/es5.js`: The module `./$.html` could not be found from `/Safee/sf-code/sf-safee-clients/sf-client-mobile/node_modules/core-js/modules/es5.js`. Indeed, none of these files exist:
* `$.html`
* `/Safee/sf-code/sf-safee-clients/sf-client-mobile/node_modules/core-js/modules/$.html/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
at ModuleResolver.resolveDependency (/Safee/sf-code/sf-safee-clients/sf-client-mobile/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:161:851)
at ResolutionRequest.resolveDependency (/Safee/sf-code/sf-safee-clients/sf-client-mobile/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:91:16)
at DependencyGraph.resolveDependency (/Safee/sf-code/sf-safee-clients/sf-client-mobile/node_modules/react-native/node_modules/metro/src/node-haste/DependencyGraph.js:272:4579)
at dependencies.map.relativePath (/Safee/sf-code/sf-safee-clients/sf-client-mobile/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:376:19)
at Array.map (<anonymous>)
at resolveDependencies (/Safee/sf-code/sf-safee-clients/sf-client-mobile/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:374:16)
at /Safee/sf-code/sf-safee-clients/sf-client-mobile/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:212:33
at Generator.next (<anonymous>)
at step (/Safee/sf-code/sf-safee-clients/sf-client-mobile/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:313)
at /Safee/sf-code/sf-safee-clients/sf-client-mobile/node_modules/react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:473
Run Code Online (Sandbox Code Playgroud)
我的包裹卡在中间了。
可能是什么问题?
我将我的项目类组织在多个src文件夹中,这些文件一直工作得很好,直到我改变了活动之间的切换,现在将字符串传递到以下活动.我认为这个问题与课程路径有关.
Bundle bundle = new Bundle();
bundle.putString("email", userEmail);
Intent intent = new Intent(MainActivity.this,
com.fm.mondev.MeanSelection.class);
intent.putExtras(bundle);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
[编辑]我意识到问题与Classes的路径并不完全相关,即使我目前有MeanSelection.class而不是com.fm.mondev.MeanSelection.class.实际上,问题似乎与捆绑有关.当我在Login和Main活动之间使用它时,它可以工作,但不能用于Main活动之后的活动.我也尝试了下面显示的替代方法.我随后编辑了相应的活动.
Intent intent = new Intent(MainActivity.this,
MeanSelection.class);
intent.putExtra("email", userEmail);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
我看过我的logcat但是我找不到任何有用的东西.我知道如果我评论putExtra(s)行,这是有效的.
[答案]在查找logcat的每个错误行并阅读您的答案后,我意识到其中一个变量通过Log.d写入了问题.因此,解决方案是删除这些行,因为它们只是为了验证变量是否通过捆绑从先前的活动中正确选取.我的结论是:从现在开始,我不会记录从一个活动传递到另一个活动的字符串.我不知道这是否真的与Android的问题或只是附带没有可行的解释,这是我们都知道这么好这些事情之一,但只要我删除这些行,我有我的应用程序启动和运行.
我正在寻找能够捕获并处理我的应用程序中的错误的工具/解决方案.我的申请是在Ionic1.我希望解决方案能够跟踪bundle.js中的错误并导致源代码(通过sourceMap).显然,我想发送更多有关错误的数据和参数.有没有人有什么建议?
我更喜欢免费工具和轻量级解决方案
谢谢.
Metasploit工作正常,直到今天早上我更新它msfupdate,然后所有人都去了.
打字msfconsole现在给我这个错误:
Could not find nokogiri-1.6.8 in any of the sources
Run bundle install to install missing gems.
Run Code Online (Sandbox Code Playgroud)
我去打字了bundle install.直到发生这种情况一切顺利:
Installing nokogiri 1.6.8 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.2 -r ./siteconf20160831-24032-1wim46x.rb extconf.rb --use-system-libraries
Using pkg-config version 1.1.7
checking if the C compiler accepts ... yes
Building nokogiri using system libraries.
checking for libxml-2.0... no
checking for libxslt... no
checking for libexslt... no
ERROR: cannot discover where libxml2 is …Run Code Online (Sandbox Code Playgroud) bundle ×7
android ×3
reactjs ×2
angularjs ×1
exception ×1
extras ×1
javascript ×1
json ×1
linux ×1
metasploit ×1
node.js ×1
package.json ×1
react-native ×1
ruby ×1
src ×1