Stealing the topic from another person when he or she is going to tell you something

Solution 1:

That's what I'd call hijacking the conversation:

VERB

[WITH OBJECT]

1.2

Take over (something) and use it for a different purpose:
the organization had been hijacked by extremists

MORE EXAMPLE SENTENCES

The public power belongs to everyone and when majorities hijack it for sectarian purposes they act oppressively.

Where Pringle is even-handed in showing how extremists have hijacked the debate over GM food, Nestle is an unapologetic partisan.

We should not let racist organisations hijack our national flag.

(Definition and examples from Oxforddictionaries.com)


Sometimes, a person who hijacks the conversation could be termed an attention whore:

Label given to any person who craves attention to such an extent that they will do anything to receive it. The type of attention (negative or positive) does not matter.

(Definition from Urbandictionary.com)

Solution 2:

There is an idiom, stealing someone's thunder

To use, appropriate, or preempt the use of another's idea, especially to one's own advantage and without consent by the originator.

Similarly steal the spotlight

to get attention for oneself. Ann always tries to steal the spotlight when she and I make a presentation

[thefreedictionary.com]

And steal the limelight

to get more attention than anyone or anything else in a situation

[Cambridge Dictionaries Online]

SUPPLEMENT:

And then there's conversational one-upmanship

behavior in which someone tries to get an advantage by doing, saying, or having better things than someone else

[Merriam-Webster]

Solution 3:

My first thought was going off on a tangent. In conversation, a subject is tangential to the original/previous subject if the two are only partially related. The person who drives the conversation to focus on a tangential subject is commonly said to be "going off on a tangent", i.e. venturing/straying away from the original subject to pursue the tangential one.

If someone wanted to do this politely, they'd first apologize for or announce the new subject's tangency: "I hate to go off on a tangent, but..." or "On a tangent: ..." or "Tangentially, ..." are all phrases I find myself using surprisingly often.