Is this morphism of spectra zero in the stable homotopy category?

Let $f\colon A\to B$ a morphism of spectra and suppose that both spectra $A$ and $B$ have only one non-zero stable homotopy group $\pi_n$, more precisely $$\pi_k(A)=0=\pi_k(B)$$ for $k\neq n$. Suppose further that $f$ induces the zero-morphism on $\pi_n$, i.e. $$\pi_n(f)\colon \pi_n(A)\to \pi_n(B)$$ is the zero-morphism of abelian groups.

Is $f$ necessarily the zero-morphism in the stable homotopy category?

I think this may be true because the heart of the usual t-structure on the stable homotopy category is equivalent to the category of abelian groups, but I am not sure about this.

Surprisingly there are non-zero morphisms of spectra (so called non-zero ghost maps) that induce the zero-map on all stable homotopy groups.

If $A$ and $B$ have only one non-zero stable homotopy group they both are Eilenberg-Maclane spectra (shifted by $n$, if you will).
Maps between E-M spectra correspond to (stable) cohomological operations and $[EM(A),EM(A)]_0=\operatorname{Hom}(A,A)$.
• Dear Grigory, thank you for the answer. Is it also true that if $A$ and $B$ have non-zero stable homotopy groups $\pi_n$ only in a finite range $a\leq n \leq b$ and $f$ is the zero morphism on all those $\pi_n$, then $f=0$? – user8463524 Jan 9 '15 at 8:35
• No, that generalization is not true: take any non-trivial stable cohomological operation — say, Bockstein $EM(n)\to EM(n+1)$. – Grigory M Jan 9 '15 at 10:53