Question: Recently I was trying out HTML tags in android. When I tried to use the `<h3>` tag, it automatically creates a line space after it and before the next line. In HTML one can remove it by making padding and margin set with 0px. Can anyone tell me how can I remove this space in an android app?

Answer: 
You could implement the [Command Pattern](http://en.wikipedia.org/wiki/Command_pattern) for all actions with execute and undo methods, and queue them up.

so when the user wants to do some thing - lets say create an AddFiveToTotal class and executes:

```
public method execute():void{
     totalModel.add( 5 );
}

```

This class would then be stored on a FIFO queue.

if the user needs to undo the command would be popped and the undo function called:

```
public method undo():void{
     totalModel.subtract( 5 );
}

```

for redoability, don't pop, just iterate the queue

also take a look at the [Memento Pattern](http://en.wikipedia.org/wiki/Memento_pattern)

If you are using any of the currently popular MVC(S) frameworks you will undoubtably find a util that some one has already created
You can acheive with help of `memento pattern`. It hard to track all properties better you can what are property need to use for undo/redo operation.

[Memento Design pattern](http://www.as3dp.com/2008/01/actionscript-30-memento-design-pattern-encapsulating-saved-states/)

[Memento pattern](http://lucamezzalira.com/2010/01/12/memento-pattern-in-actionscript-3-undoredo/)

Demo sample with source code <http://www.flairpy.com/mementoPattern/MementoSample.html>