This commit is contained in:
wangcongtao
2020-03-13 17:15:28 +08:00
parent 2381496c51
commit ed0ed93eb1
7 changed files with 37 additions and 21 deletions

View File

@@ -367,6 +367,12 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
}
}
@Override
protected void onNewIntent( Intent intent ) {
super.onNewIntent( intent );
mPresenter.handleSchemeIntent( intent );
}
@Override
protected void onDestroy() {
super.onDestroy();

View File

@@ -1,5 +1,7 @@
package com.mogo.module.main;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -136,4 +138,16 @@ public class MainPresenter extends Presenter< MainView > {
msg.what = MainConstants.MSG_LOAD_MODULES;
mMsgHandler.sendMessageDelayed( msg, 100 );
}
public void handleSchemeIntent( Intent intent ) {
if ( intent == null || intent.getData() == null ) {
return;
}
Uri target = intent.getData();
switch ( target.getPath() ) {
case "/main/switch2":
mView.switch2Card( target.getQueryParameter( "type" ), true );
break;
}
}
}