【问题标题】:how to restart android avd?如何重新启动android avd?
【发布时间】:2011-11-26 07:22:23
【问题描述】:

我想在我的程序中捕获 BOOT_COMPLETED 动作,如何重新启动 AVD? 提前谢谢.....

package com.alex.app.testsysaction;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class MyReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.i("receiver", "system reboot completed.......");
    }
}

AndrdoiManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.alex.app.testsysaction"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="3" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <receiver android:name=".MyReceiver">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
            </intent-filter>
        </receiver>
    </application>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
</manifest>

【问题讨论】:

  • 这太简单了,您必须在重新启动设备后尝试过。

标签: android avd reboot


【解决方案1】:

在 AVD 上安装应用程序。

关闭它然后手动重新启动它。它将捕获重新启动操作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-12
    • 2014-11-26
    • 2012-06-03
    • 2015-05-13
    相关资源
    最近更新 更多