سؤال

I know this coding :

startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"));

to intent to Notification Access section in Settings to enable/disable the application for granting the permission to get notification or not.

But my application was not shown in it.

People who know how to register my application in Notification Access section in Settings,

Please tell me,

Thanks,

p/s : Here is my Manifest.xml file:

<!-- Application -->
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/Theme" >

        <!-- Activities -->
        <activity
            android:label="@string/app_name"
            android:name=".ActivityTDBand" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
هل كانت مفيدة؟

المحلول

After I add this coding to my manifest file :

<!-- Services -->
        <service android:name="controller.BluetoothLeService" />
        <service
            android:name="utils.NotificationListener"
            android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" >
            <intent-filter>
                <action android:name="android.service.notification.NotificationListenerService" />
            </intent-filter>
        </service>

Can see it in Notification Access section.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top