IntentService から Service に変数を渡したいと思います。
私が持っていると仮定します: MyService.java と MyIntentService.java
public class MyService extends Service {
public static String myString = "";
}
public class MyIntentService extends IntentService {
protected void onHandleIntent(Intent intent)
{
MyService.myString = "My New String Value";
}
}
このように機能しますか?それとも Intent.putextra(...) メソッドを使用する必要がありますか?