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

@@ -12,8 +12,8 @@
android:resumeWhilePausing="true"
android:screenOrientation="landscape"
android:stateNotNeeded="true"
android:theme="@style/Main"
android:taskAffinity=""
android:theme="@style/Main"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -23,6 +23,15 @@
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<data
android:host="launcher"
android:path="/main/switch2"
android:scheme="mogo" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
</application>
</manifest>

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;
}
}
}