2011-11-26 134 views
1

我想赶上我的程序中的BOOT_COMPLETED动作,如何重新启动AVD? 在此先感谢.....如何重新启动android 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> 
+0

这很容易,你必须尝试一次,一旦重新启动您的设备。 –

回答

1

AVD上安装应用程序。

关闭它,然后重新手动重新启动它。它会捕获重新启动动作