Skip to content

Instantly share code, notes, and snippets.

@nalitzis
Created February 8, 2013 22:02
Show Gist options
  • Select an option

  • Save nalitzis/4742310 to your computer and use it in GitHub Desktop.

Select an option

Save nalitzis/4742310 to your computer and use it in GitHub Desktop.
@Override
public IBinder onBind(Intent intent) {
return binder;
}
private final IMultiplier.Stub binder = new IMultiplier.Stub() {
@Override
public void multiply(final int a, final int b) throws RemoteException {
final int result = a*b;
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable(){
@Override
public void run() {
Toast.makeText(getApplicationContext(), a+"*"+b+"= "+result, Toast.LENGTH_SHORT).show();
}
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment