我正在尝试制作一种可以从服务返回结果的方法问题是这样的:
public int getResult{
int result;
//I'm sending request with PendingIntent here, but here I don't have my variable returned
return result;
}
public void onActivityResult (int requestCode, int resultCode, Intent data) {
//because a result from a service comes here and i can't put it in a previous method - that's a problem for me
}
是否有任何想法使 int getResult 方法不仅会发送请求而且还会返回结果?