Question: I know a handler is bound to the thread's message queue in which it is created, but what if i create a handler in a service and posting a runnable declared in activity to which my service is bound.
For example:
In service:-

```
Handler handler=new Handler();
handler.post(Mainactivity.runnable);

In activity inside oncreate method:-

Runnable runnable=new Runnable(){
    public void run{
       //some code here
    }
};

```

Can someone please explain me what's happening here?

Answer: 
Because after preprocessing, your code will look similar to that:

```
a[i] = {  return (a[i] >=0)? (int)(a[i]+0.5) : (int)(a[i]-0.5) ; }

```

If you like to stick to macro, declare it as:

```
#define round(N) ((N) >=0)? (int)((N)+0.5) : (int)((N)-0.5)

```

But this is still not really correct because of int/float mixing. That is however already a different topic.
Like it was told to you in a comment, macros aren't functions. They are a token substitution mechanism. So you do not return from them as you would a function.

```
#define round(N) (((N) >=0)? (int)((N)+0.5) : (int)((N)-0.5))

```

The changes I made include:

1. Making it an expression. This involves replacing the curly braces with parentheses. This is so you could use the macro almost anywhere you could use a function. Had I left the curly braces it would have been a compound statement.
2. Wrapping the parameter N in parentheses as well, to make sure operator precedence doesn't come back and bite us.