Catalysis of the transfer of a segment of a (1->4)-alpha-D-glucan to a new 4-position in an acceptor, which may be glucose or (1->4)-alpha-D-glucan.
1,4-alpha-D-glucan:1,4-alpha-D-glucan 4-alpha-D-glycosyltransferase activity