TestServiceの全体的なリファクタリング #28
@@ -136,6 +136,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
registerReceiver(receiver, intentFilter);
|
registerReceiver(receiver, intentFilter);
|
||||||
|
|
||||||
|
startForegroundService(new Intent(this, TestService.class));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -334,8 +336,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onStop() {//アプリをバックグラウンドにした時のメソッド
|
public void onStop() {//アプリをバックグラウンドにした時のメソッド
|
||||||
super.onStop();
|
super.onStop();
|
||||||
Intent intent = new Intent(getApplication(), TestService.class);
|
// Intent intent = new Intent(getApplication(), TestService.class);
|
||||||
startService(intent);//TestServiceを起動
|
// startService(intent);//TestServiceを起動
|
||||||
}
|
}
|
||||||
|
|
||||||
public void NotificationBluetooth(Context context) {//実際に通知を行うメソッド
|
public void NotificationBluetooth(Context context) {//実際に通知を行うメソッド
|
||||||
|
|||||||
Reference in new issue
Block a user