Search code examples
androidhuawei-mobile-servicesappgallery

How do I switch from a quick app to an Android app?


Can I switch from a quick app to an Android app? How to operate it?


Solution

    1. Add an external schema to the activity of the target app to be redirected to. The sample code is as follows:

      <activity 
      
          android:label="@7F070043" 
      
          android:name="com.huawei.phoneservice.HelpCenterActivity" 
      
          android:exported="true" 
      
          android:excludeFromRecents="true" 
      
           android:launchMode="2" 
      
          android:configChanges="0x40002D84"> 
      
               <intent-filter> 
      
                       <action android:name="android.intent.action.VIEW"></action> 
      
                       <category android:name="android.intent.category.DEFAULT"> </category> 
      
                       <category android:name="android.intent.category.BROWSABLE"></category> 
      
                      <data android:scheme="hwphoneservice" android:host="externalapp"></data> 
      
              </intent-filter> 
      
      </activity> 
      
    2. In the quick application, invoke the system.router.push interface to invoke the redirection function. That is, the router.push interface transfers the schema configured in the preceding step.

      router.push({uri:"hwphoneservice://externalapp/service"})