mehdi-moradpoor
Member
Hi everyone
This Code for Check Notifications Are Enables or Not ,That's What I use:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
in Android 13 or 14 its OK ,But in Android 7.1 and 9, I got This error :
(Exception) java.lang.Exception: java.lang.RuntimeException: Method: from not found in: androidx.core.app.NotificationManagerCompat
I am confused about this ,it is impossible!
			
			This Code for Check Notifications Are Enables or Not ,That's What I use:
			
				AreNotificationsEnabled:
			
		
		
		Private Sub AreNotificationsEnabled As Boolean 'areNotificationsEnabled method Added in API level 24
        Try
        Dim p As Phone : Log("SDK version : "&p.SdkVersion)
        Dim nJO As JavaObject
        Dim ctxt As JavaObject
        ctxt.InitializeContext
        nJO = nJO.InitializeStatic("android.support.v4.app.NotificationManagerCompat").RunMethod("from", Array(ctxt))
        Return nJO.RunMethod("areNotificationsEnabled", Null)
        Catch
            Log(LastException)
        Return False
        End Try
End Subin Android 13 or 14 its OK ,But in Android 7.1 and 9, I got This error :
(Exception) java.lang.Exception: java.lang.RuntimeException: Method: from not found in: androidx.core.app.NotificationManagerCompat
I am confused about this ,it is impossible!
 
				 
 
		 
			 
 
		 , I used this code, The code is OK no problem in Android 9+
, I used this code, The code is OK no problem in Android 9+ 
 
		 
 
		