如何使用java和flamingo停止android 12中的蓝牙应用程序进程和nfc服务进程或系统应用程序中的其他名称进程?

问题描述 投票:0回答:1

我使用 android studio 2022.2.1 flamingo JDK 17 Gradle 8.7

蓝牙和 NFC 已关闭,但我发现名为蓝牙应用程序和 NFC 服务应用程序的系统应用程序有时会运行,即使我手动停止应用程序进程也是如此。

如何使用 java 和 flamingo 停止 Android 12 系统应用程序中的蓝牙应用程序进程和 nfc 服务进程或其他名称的进程,并安排在后台运行以每 10 秒停止这些应用程序进程?

我是 Android 编程新手,Mainactivity.java 在编译前在代码下划线处显示缺少权限

此视图不受限制。

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
java android android-studio android-bluetooth
1个回答
0
投票

我不确定您为什么要尝试停止这些服务,因为它们被设计为一直运行并自动重新启动。

还有

<uses-permission>
XML 元素不属于 XML 视图文件,它们仅属于“AndroidManifest.xml”文件。

所以你把它们用在了错误的地方。

© www.soinside.com 2019 - 2024. All rights reserved.