Have you ever encountered a situation where a link from a messenger or browser opens in an unexpected application? For example, instead of YouTube, a browser is launched, and instead of Telegram, a web version? On Xiaomi smartphones with a MIUI shell, this is a common problem associated with link processing settings. Unlike โpureโ Android, there are nuances here, from hidden developer parameters to the features of working with Default Apps.
In this article, we will discuss all the current ways to link to the desired applications on Xiaomi, Redmi, Poco and Black Shark devices (including models from 2023-2026).
- ๐ง Set up link opening through standard settings MIUI
- ๐ฑ Use the developer parameters for binding
- ๐ Solve the problem with web links (HTTP/HTTPS) deep links
- ๐ Reset the opening settings if something goes wrong
We will pay special attention to the hidden limitations of MIUI 14, which block the change of link handlers for some system applications (for example, Mi Browser or Mi Video).
Why are links opening in the wrong app?
The problem with โincorrectโ link opening on Xiaomi is usually due to three factors:
- Processor conflict: Android allows multiple applications to claim to handle the same type of link (e.g., youtube.com can open both the browser and the official YouTube app).
- Settings MIUI Xiaomiโs shell aggressively promotes its services: video links can open in Mi Video and web pages can open in Mi Browser, even if you prefer Chrome or Firefox.
- Android cache errors: Sometimes the system forgets your choice of handler due to a crash in PackageManager or after updates.
Devices with MIUI 12-14 also have an โApp Cloningโ mechanism that can duplicate link handlers, for example, if you have both the main Telegram and its clone installed, the system may be confused as to which one should open t.me links.
Method 1: Configure with โDefault Appsโ in MIUI
The most obvious method is to use the built-in shell settings, which works for most applications other than system ones (e.g. Mi Browser or Mi Music, where Xiaomi limits changes).
Instructions:
- Open Settings โ Applications โ Applications by default.
- Select a category: ๐ Browser for HTTP/HTTPS-reference ๐บ Player โ for video and streaming services ๐ฑ Other applications - for messengers, social networks, etc.
Click on the current default application and select the one you want from the list.
โ ๏ธ Attention: B MIUI 14 some items may be blocked. For example, if you're trying to change your browser from Mi Browser to Chrome, the system can return the settings back after you reboot.
Make sure the right app is installed and updated
Close all background applications (especially browsers)
Check if there are duplicate applications (clones via Dual Apps)
Restart the device before setting up-->
Method 2: Using Developer Parameters
If standard settings donโt help, turn on developer mode and force handlers to be assigned, especially for Xiaomi, where MIUI blocks changes to system applications.
Steps:
- Activate Developer Mode: Go to Settings โ About Phone. Click 7 times on the MIUI Version until the notification "You've become a developer" appears.
Settings โ Additional โ For Developers
Forced link opening
WebView implementation
Select the desired application from the list.
For deep links (such as instagram:// or tg://), use the ADB command:
adb shell pm set-app-links --package com.example.app trueWhere com.example.app is the batch name of the application (for example, org.telegram.messenger for Telegram).
How to find out the package name of the application?
Method 3: Resetting link opening settings
If the system ignores your settings or constantly asks which app to use, resetting the handlers cache will help, which will remove all saved preferences and force Android to re-query your choices.
How to reset:
- Go to Settings โ Applications โ All applications.
- Choose an app that handles links incorrectly (like Chrome or Mi Browser).
- Press Warehouse. โ Clear the cache and Clear the data (โ ๏ธ This will remove all application settings, including bookmarks!).
- For a complete reset, run the command: adb shell pm clear-package-preferred-activities
After resetting the first time you open a link, the system will again ask which application to use. Choose the right one and mark Always.
๐ก
If the reset didnโt work, try removing updates for system applications (such as Mi Browser) through Settings โ Apps โ Remove updates. This will bring the app back to the factory version, where link handlers may work differently.
Method 4: Manual editing of package.xml file (for advanced)
This method requires root rights and is designed for power users, and allows you to manually change the priorities of link handlers in the system file /data/system/package.xml.
Instructions:
- Get root access (for example, through Magisk).
- Use a root-enabled file manager (such as Root Explorer) and open the file: /data/system/package.xml
- Find a section with link handlers (look for <intent-filter> tags with android:scheme="http" or android:scheme="https").
- Change the priority (android:priority) for the desired application to a higher one (for example, from 100 to 1000).
- Save the file and restart the device.
โ ๏ธ Attention: Incorrect editing package.xml It can cause the system to crash or the inability to open any links!
| Annex | Package name | Type of reference | Default priority |
|---|---|---|---|
| Chrome | com.android.chrome | HTTP/HTTPS | 500 |
| Mi Browser | com.android.browser | HTTP/HTTPS | 1000 |
| YouTube | com.google.android.youtube | youtube://, https://youtu.be | 700 |
| Telegram | org.telegram.messenger | tg://, https://t.me | 600 |
Solving problems with specific applications
Some applications require a separate approach, and let's look at the most common cases:
YouTube opens in the browser instead of the app
The problem arises from the conflict between youtube:// and https://youtube.com. Decision:
- Remove YouTube updates (if you have a beta version installed).
- Clear the cache and data of YouTube and the browser.
- In the developer settings, disable Forced Link Opening.
Telegram does not open t.me links
Often associated with duplicate handlers due to Dual Apps:
- Remove the Telegram clone (if any) in Settings โ Dual Apps.
- Adb shell pm set-app-links --package org.telegram.messenger true
Also common is resetting after the MIUI update, to avoid this:
- Before updating, make a backup through Settings โ About Phone โ Backup.
- After the update, reassign link handlers (especially for browser and instant messengers).