我什么都不知道.如何在sdcard上安装时自动安装apk?
但是,我有一个问题,当我注册听取ACTION_MEDIA_SHAREDAndroidManifest.xml Em中的接收器时...我创建了一个扩展的接收器BroadcastReceive,我覆盖OnReceive().但是,最后,接收者无法获得任何行动.这是我的代码.令人沮丧的!!!!!
<receiver android:name=".SdcardPutOnListener"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.ACTION_MEDIA_BAD_REMOVAL" />
<action android:name="android.intent.action.ACTION_MEDIA_MEDIA_CHECKING" />
<action android:name="android.intent.action.ACTION_MEDIA_EJECT" />
<action android:name="android.intent.action.ACTION_MEDIA_MOUNTED" />
<action android:name="android.intent.action.ACTION_MEDIA_NOFS" />
<action android:name="android.intent.action.ACTION_MEDIA_REMOVED" />
<action android:name="android.intent.action.ACTION_MEDIA_SHARED" />
<action android:name="android.intent.action.ACTION_MEDIA_UNMOUNTABLE" />
<data android:scheme="file" />
<category android:name="android.intent.category.HOME"/>
</intent-filter>
</receiver>
public class SdcardPutOnListener extends BroadcastReceiver {
final static String TAG = "SdcardPutOnListener";
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "receive broadcast " + intent.getAction());
}
}
Run Code Online (Sandbox Code Playgroud)