hallo,
I have made an activity that simply binds to a service,here is my
code :
public class LaunchApp extends Activity {
/** Called when the activity is first created. */
Button dial;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Toast.makeText(this, "text", Toast.LENGTH_LONG).show();
dial=(Button)findViewById(R.id.call_buddy);
dial.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
launch_app();
}
private void launch_app() {
Intent launch_app=new Intent();
launch_app.setComponent(new ComponentName
("aexp.share.sharedapp1","aexp.share.sharedapp1.Service1"));
bindService(launch_app,mconnection,Context.BIND_AUTO_CREATE);
}
});
}
ServiceConnection mconnection=new ServiceConnection(){
@Override
public void onServiceConnected(ComponentName
name,
IBinder service) {
Log.e("tag","connected");
}
@Override
public void onServiceDisconnected(ComponentName
name) {
Log.e("tag","disconnected");
}};
}
i just want to get a message in the log when my activity connects
succesfully or disconnects from the service.The above code does not do
this and the messages are never written to the Log,can you give me
some fixes for this code?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en