APP處於主界面是arouter跳轉失效

項目是多模塊的,現在需要收到一個極光推送的通知,點擊通知,從一個模塊跳轉到另一個模塊的activity,

但是嘗試發現,通過arouter跳轉,

1、當APP在前臺的時候,點擊可以正常跳轉

2、APP在後臺,其他APP在前臺,可以跳轉

3、APP在後臺,停在主頁面,點擊卻報,no postcard; 找不到要跳轉的路徑了。

沒得辦法,使用隱式跳轉實現的。

  <activity
            android:name="com.chat.ui.ChatActivity"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustResize" >

            <intent-filter>
                <action android:name="com.im.intent.action.chatactivity" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
// 隱式 intent 跳轉activity
        val implicitIntent = Intent()
        implicitIntent.action = "com.im.intent.action.chatactivity"
        implicitIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
        val extraBundle = Bundle()
        extraBundle.putString(PAGER_TITLE, name)
        extraBundle.putString(UID, uid)
        extraBundle.putInt(CLASSIFY, classify)
        implicitIntent.putExtra(EXTRA, extraBundle)

        context.startActivity(implicitIntent)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章