Skip to content

Commit 9c11306

Browse files
committed
完善帮助类跳转
1 parent 2697db6 commit 9c11306

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

module-communication-ksp/src/main/java/com/flyjingfish/module_communication_ksp/CommunicationKspSymbolProcessor.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,18 @@ class CommunicationKspSymbolProcessor(
302302
"android.content.Intent"
303303
)
304304
)
305+
whatsMyName1.addStatement(
306+
"if (context !is %T) {",
307+
ClassName.bestGuess(
308+
"android.app.Activity"
309+
)
310+
)
311+
whatsMyName1.addStatement(
312+
" intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)"
313+
)
314+
whatsMyName1.addStatement(
315+
"}"
316+
)
305317
paramMap?.forEach { (_, value) ->
306318
val config = value.annoMap["@RouteParams"]
307319
if (config != null){
@@ -332,7 +344,7 @@ class CommunicationKspSymbolProcessor(
332344
"routeClazz.goByPath(\"$usePath\",paramMap,false,pathInfo,intent){"
333345
)
334346
whatsMyName1.addStatement(
335-
" context.startActivity(intent)",
347+
" context.startActivity(intent)",
336348
)
337349
whatsMyName1.addStatement(
338350
"}"

0 commit comments

Comments
 (0)