这两天研究Android Service,前面已经贴了几遍文章。
下面一个主题就是 :Service 回调 Activity的方法。
=====================================================================
package com.test;
import com.test.service.IService;
import com.test.service.MyService;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
public class ServiceCallbackActivity extends Activity {
private static final String TAG = "MyService";
private IService mService;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent i = new Intent(this, MyService.class);
bindService(i, mConnection, Context.BIND_AUTO_CREATE);
}
@Ov