これが私のサービスクラスです
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
public class Communicationservice extends Service {
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}
@Override
public void onCreate() {
super.onCreate();
Log.d("I AM Service","Service Created");
}
@Override
public void onStart(Intent intent, int startId) {
// TODO Auto-generated method stub
super.onStart(intent, startId);
}
}
Here is my Main Activity
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d("flow","1");
Intent in = new Intent("com.yal.Communication.Communicationservice");
this.startService(in);
//startService(new Intent(MainActivity.this,Communicationservice.class));
Log.d("flow","2");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
これがMainfest.xmlです
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity > ... </activity>
<service android:enabled="true" android:name="com.yal.Communication.Communicationservice"></service>
</application>
エラー
11-02 16:34:17.939: D/flow(1390): 1
11-02 16:34:17.939: W/ActivityManager(92): Unable to start service Intent { act=com.yal.Communication.Communicationservice }: not found
11-02 16:34:17.939: D/flow(1390): 2