Intentservice の onHandleIntent() メソッド内で単純な fql クエリを実行しています。問題が何であるかわからない、クエリの部分だけが実行されていません。これが私の onHandleIntent() メソッドです
protected void onHandleIntent(Intent intent)
{
System.out.println("inside service method now");
String fqlQuery = "SELECT uid, username, online_presence, status FROM user WHERE uid = 100001024732884";
Bundle params = new Bundle();
params.putString("q", fqlQuery);
Session session = Session.getActiveSession();
Request request = new Request(session,
"/fql",
params,
HttpMethod.GET,
new Request.Callback(){
public void onCompleted(Response response) {
System.out.println("inside the service now 4444");
Log.i(TAG, "Result: " + response.toString());
}
});
Request.executeBatchAsync(request);
}
最初のステートメントのみが印刷されます。
MainActivity に同じコードを入れると正常に動作しますが、IntentService 内では動作しなくなります。ボタンクリックでサービスを開始しています。