I want to check if one application is enabled or disabled by the user.
The only thing i know is that i can get this int
int appstate= this.getPackageManager().getApplicationEnabledSetting("com.example.app");
How can i use this int to check if the app is enabled or disabled?
Example
if(......){//is enabled
}
else{
//disabled
}
From your Home screen, tap the Application screen icon. Find and tap Settings > Apps. Swipe to the Disabled tab.
Enabling R8 in your project To enable R8, open build. gradle module app file and add this piece of code inside the buildTypes . The code inside the release{} block means that this will be applied to the release build version of your application. If you launch the app in the emulator, this code is not executed.
Call the method isPackageInstalled() : boolean isAppInstalled = isPackageInstalled("com. android. app" , this.
If the user has installed the web app using the new Web APK functionality, it is possible to determine if your web app is installed. If you know the package name of your Web APK then you can use the context. getPackageManager(). getApplicationInfo() API to determine if it is installed.
ApplicationInfo ai =
getActivity().getPackageManager().getApplicationInfo("your_package",0);
boolean appStatus = ai.enabled;
Thanks to Amir
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With