Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 没有任何UI的jellybean服务应用程序中的Broadcast接收器事件失败_Android_Broadcastreceiver - Fatal编程技术网

Android 没有任何UI的jellybean服务应用程序中的Broadcast接收器事件失败

Android 没有任何UI的jellybean服务应用程序中的Broadcast接收器事件失败,android,broadcastreceiver,Android,Broadcastreceiver,我想创建一个没有任何UI的应用程序,它应该是服务应用程序。我在2.3(姜饼)中运行应用程序时,在应用程序中使用了启动完成事件版本,然后它的工作正常,但它不在Jellybean版本工作。但如果我运行任何活动的应用程序,那么它在两个版本中都正常工作。请给我一个解决方案 AndroidManifest文件 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.bo

我想创建一个没有任何UI的应用程序,它应该是服务应用程序。我在2.3(姜饼)中运行应用程序时,在应用程序中使用了启动完成事件版本,然后它的工作正常,但它不在Jellybean版本工作。但如果我运行任何活动的应用程序,那么它在两个版本中都正常工作。请给我一个解决方案

AndroidManifest文件

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.bootreceivecheck"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <receiver android:name="com.home.BootReceiver.BootCompleteReceiver" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />             
            </intent-filter>
        </receiver>

    </application>

</manifest>

在蜂巢之后,它是不允许任何类型的隐藏应用程序的,至少您应该向用户提供某种类型的控制UI活动。请检查这个类似的问题-和相关的谢谢,先生,我们不能用另一种方式隐藏应用程序吗?
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;


public class BootCompleteReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent arg1) {
        try
        {
            Toast.makeText(context, "Mobile Boot Completed", Toast.LENGTH_LONG).show();
        }catch(Exception ex)
        {
            Toast.makeText(context, ex.getMessage(), Toast.LENGTH_LONG).show();
        }

    }

}