Android启动远程服务

来源:互联网 发布:sql注入站点 编辑:程序博客网 时间:2024/05/01 14:46

一、在服务注册时添加服务的Action,

<service android:name="com.greetty.remoteservice.RemoteService">        <intent-filter >              <action android:name="com.greetty.remote"/>        </intent-filter></service>
二、启动远程服务,Action必须和前面注册的Action一样

public void click(View v){//启动远程服务Intent intent = new Intent();intent.setAction("com.greetty.remote");startService(intent);}



1 0
原创粉丝点击