Qihoo360 / RePlugin

RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework
Apache License 2.0
7.27k stars 1.53k forks source link

android.app.Fragment不支持跳转插件吗? #631

Open cmeiyuan opened 6 years ago

cmeiyuan commented 6 years ago

在一个插件的android.app.Fragment里调用startActivityForResult(),不能转转到另一个插件。 例如:

public class DemoFragment extends android.app.Fragment{
    Intent intent = new Intent();
    intent.setComponent(new ComponentName("com.xxx.plugin,"com.xxx.pluign.OtherActivity"));
    startActivityForResult(intent, 100);
}

跟了下源码 android.app.Fragment.startActivityForResult() ->mHost.onStartActivityFromFragment() ->Activity.HostCallbacks.onStartActivityFromFragment() ->Activity.this.startActivityFromFragment(fragment, intent, requestCode, options); 综上可知,Replugin还不能支持在anroid.app.Fragment里跳转插件?

pijie commented 6 years ago

确实没有提供呀 , 只能使用Replugin.startActivityForResult 方式启动插件 但是请求结果不会被传递到 Fragment
只能再activity 中拦截再传递到fragment

cmeiyuan commented 6 years ago

反正Android P要弃用android.app.Fragment了,我还是改用support.v4里的Fragment吧

jiashie commented 6 years ago

反正Android P要弃用android.app.Fragment了,我还是改用support.v4里的Fragment吧

replugin也不support v4的fragment.startActivityForResult啊

Tornaco commented 6 years ago

反正Android P要弃用android.app.Fragment了,我还是改用support.v4里的Fragment吧

replugin也不support v4的fragment.startActivityForResult啊

https://github.com/Qihoo360/RePlugin/blob/dev/replugin-plugin-library/replugin-plugin-lib/src/main/java/com/qihoo360/replugin/loader/a/PluginFragmentActivity.java

看这个下面的注释是支持?

cmeiyuan commented 6 years ago

反正Android P要弃用android.app.Fragment了,我还是改用support.v4里的Fragment吧

replugin也不support v4的fragment.startActivityForResult啊

支持的