欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android實現(xiàn)從activity中停止Service的方法

 更新時間:2016年01月21日 09:36:48   作者:nosxcy  
這篇文章主要介紹了Android實現(xiàn)從activity中停止Service的方法,結合實例形式簡單分析了Android中Service的注冊、創(chuàng)建及使用stopService停止Service的方法,需要的朋友可以參考下

本文實例講述了Android實現(xiàn)從activity中停止Service的方法。分享給大家供大家參考,具體如下:

1、在AndroidManifest.xml注冊Service

<service android:name=".service.SensorService" >
  <intent-filter>
    <action android:name="ITOP.MOBILE.SIMPLE.SERVICE.SENSORSERVICE"/>
  </intent-filter>
</service>

2、在Activity中調(diào)用

final Intent intent = new Intent();
intent.setAction("ITOP.MOBILE.SIMPLE.SERVICE.SENSORSERVICE");
stopService(intent);

更多關于Android開發(fā)相關內(nèi)容感興趣的讀者可查看本站專題:《Android開發(fā)入門與進階教程

希望本文所述對大家Android程序設計有所幫助。

相關文章

最新評論