独自にサービスを開始する方法?? 別のアクティビティからサービスを開始したくありませんが、サービスをアクティビティにバインドしたい..私の問題は、このリンクで説明されているとおりです。 bindService メソッドの後に onServiceConnected が呼び出されることはありません。つまり、onserviceconnected が呼び出されることはありません。
Messenger mService = null;
public void onServiceConnected(ComponentName className, IBinder service) {
mService = new Messenger(service);
Log.d("IMSLogging", "inside onServiceConnected");
}
アクティビティの oncreate から bindService. を呼び出していますが、mService.send(msg); を実行しているときに nullpointerexception が発生しています。oncreate から (もちろん、bindService が呼び出された後)、bindService は true を返しますが、