我正在尝试发送Serializable对象从一个应用程序发送到另一个应用程序。
我的 Android 应用程序有一个可序列化的类
\n\npublic class MyClass implements Serializable\nRun Code Online (Sandbox Code Playgroud)\n\n然后我将其中的一个实例用于意图
\n\nMyClass myObject = new MyClass();\nintent.putExtra("payItem", myObject);\nintent.setAction("com.mypackage.some.action");\nRun Code Online (Sandbox Code Playgroud)\n\n当我调用startActiviy时
\n\nstartActivity(intent);\nRun Code Online (Sandbox Code Playgroud)\n\n我的应用程序崩溃了
\n\n5-16 11:09:24.738 30673-30673/? E/AndroidRuntime: FATAL EXCEPTION: main\nProcess: system:ui, PID: 30673\njava.lang.RuntimeException: Unable to start activity ComponentInfo{android/com.android.internal.app.ResolverActivity}: java.lang.RuntimeException: Parcelable encountered ClassNotFoundException reading a Serializable object (name = com.mypackage.MyClass)\n at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2955)\n at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)\n at android.app.ActivityThread.-wrap11(Unknown Source:0)\n at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)\n at android.os.Handler.dispatchMessage(Handler.java:105)\n at android.os.Looper.loop(Looper.java:164)\n at android.app.ActivityThread.main(ActivityThread.java:6938)\n at java.lang.reflect.Method.invoke(Native Method)\n at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)\n at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)\n Caused by: java.lang.RuntimeException: …Run Code Online (Sandbox Code Playgroud) thymeleaf 内容辅助不起作用,当我在 HTML 文件中输入 th: 前缀时,仅显示 th:block 提案。
<th:block
Run Code Online (Sandbox Code Playgroud)
我尝试将 Thymeleaf 处理器建议移至 HTML 文件的 STS/elipse 设置中的顶部,但不起作用。
该项目是Spring Boot + Thymeleaf,Gradle片段:
plugins {
id 'org.springframework.boot' version '2.1.4.RELEASE'
id 'java'
}
apply plugin: 'io.spring.dependency-management'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
implementation "org.springframework.boot:spring-boot-devtools"
}
Run Code Online (Sandbox Code Playgroud)
我添加了 html 命名空间:
<html xmlns:th="http://www.thymeleaf.org">
Run Code Online (Sandbox Code Playgroud)
将 th 名称空间更改为另一个名称空间不起作用;
好吧,唯一的工作时间是 th 只是替换了 HTML th 位置......
<table>
<tbody>
<tr th:
Run Code Online (Sandbox Code Playgroud)