TestServiceの全体的なリファクタリング #28
| @ -65,13 +65,16 @@ public class TestService extends Service { | ||||
| 
 | ||||
|     @Override | ||||
|     public int onStartCommand(Intent intent, int flags, int startId) { | ||||
|         this.userId = getSharedPreferences("app_situation", MODE_PRIVATE).getString("ID", null); | ||||
|         if (getSharedPreferences("app_situation", MODE_PRIVATE).getString("ID", null) == null) { | ||||
|             Log.d("onResume", "ID not initialized."); | ||||
|             return flags; // IDが初期化されていない場合は何もしない | ||||
|         } | ||||
| 
 | ||||
|         setSnapshotListener(FirebaseFirestore.getInstance().document("status/" + this.userId)); | ||||
| 
 | ||||
|         if (isNotBluetoothGranted()) return flags; | ||||
| 
 | ||||
|         registerReceiver(receiver); | ||||
|         return flags; | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user