Hi,
I created remote service and wanted to get the data from MyActivity's
onCreate().
Below bindService returns "true" but ServiceConnection() is not called.
Hence testService remains "null" and I couldn't get the data I want from
onCreate.
Any Suggestion?
public class MyActivity extends Activity
{
private ITestInterface testService = null;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
bindService(new Intent(ITestInterface.class.getName()),
serConn, Context.BIND_AUTO_CREATE);
}
private ServiceConnection serConn = new ServiceConnection()
{
@Override
public void onServiceConnected(ComponentName name, IBinder service)
{
testService = ITestInterface.Stub.asInterface(service);
}
@Override
public void onServiceDisconnected(ComponentName name)
{
}
};
}
--
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