在Android5.0以前可以通过隐式Intent方式启动其他App的Service,就跟Activity启动隐式Intent一样的. 但是在5.0以后,只能使用显示的Intent方式启动了. 启动其他App的Service,需要用到Intent的setComponent()方法.该方法需要传入ComponentName component 这个参数. 参数的解释:component, The name of the application component to handle the int
几个启动指定程序activity的例子 Music 和 Video(音乐和视频)的启动方法为: # am start -n com.android.music/com.android.music.MusicBrowserActivity # am start -n com.android.music/com.android.music.VideoBrowserActivity # am start -n com.android.music/com.android.music.MediaPlayb
Service是Android中一个类,它是Android四大组件之一,使用Service可以在后台执行长时间的操作( perform long-running operations in the background ),Service并不与用户产生UI交互.其他的应用组件可以启动Service,即便用户切换了其他应用,启动的Service仍可在后台运行.一个组件可以与Service绑定并与之交互,甚至是跨进程通信(IPC).例如,一个Service可以在后台执行网络请求.播放音乐.执行文件读