An electronic device (100, 300), comprising: a display (112, 340); one or more processors (120, 310); an accelerometer; a magnetometer; a memory (102, 370); a plurality of application programs (136, 136-1); and one or more programs (137..149-6, 151..155), wherein the one or more programs (137..149-6, 151..155) are stored in the memory (102, 370) and configured to be executed by the one or more processors (120, 310), the one or more programs (137..149-6, 151..155) comprise an instruction, and the instruction is used to: obtain a first group of data detected by the accelerometer and a second group of data detected by the magnetometer; determine, on the basis that a part or all of data in the first group of data and a part or all of data in the second group of data meet a preset condition, that the electronic device (100, 300) is attached onto a vehicle magnetic suction bracket; and start at least one application, wherein the at least one application is a preset application or an application determined by the electronic device (100, 300) based on a preset rule, wherein the basis that a part or all of data in the first group of data and a part or all of data in the second group of data meet a preset condition comprises: determining, based on at least the part or all of data in the first group of data, that one collision occurs on the electronic device (100, 300); and determining, based on at least the part or all of data in the second group of data, that a strength of a magnetic field in which the electronic device (100, 300) is located within a preset length of time after the collision occurs on the electronic device (100, 300) is greater than a first threshold or a strength variation of the magnetic field is greater than a second threshold. a display (112, 340); one or more processors (120, 310); an accelerometer; a magnetometer; a memory (102, 370); a plurality of application programs (136, 136-1); and one or more programs (137..149-6, 151..155), wherein the one or more programs (137..149-6, 151..155) are stored in the memory (102, 370) and configured to be executed by the one or more processors (120, 310), the one or more programs (137..149-6, 151..155) comprise an instruction, and the instruction is used to: obtain a first group of data detected by the accelerometer and a second group of data detected by the magnetometer; determine, on the basis that a part or all of data in the first group of data and a part or all of data in the second group of data meet a preset condition, that the electronic device (100, 300) is attached onto a vehicle magnetic suction bracket; and start at least one application, wherein the at least one application is a preset application or an application determined by the electronic device (100, 300) based on a preset rule, wherein the basis that a part or all of data in the first group of data and a part or all of data in the second group of data meet a preset condition comprises: determining, based on at least the part or all of data in the first group of data, that one collision occurs on the electronic device (100, 300); and determining, based on at least the part or all of data in the second group of data, that a strength of a magnetic field in which the electronic device (100, 300) is located within a preset length of time after the collision occurs on the electronic device (100, 300) is greater than a first threshold or a strength variation of the magnetic field is greater than a second threshold. obtain a first group of data detected by the accelerometer and a second group of data detected by the magnetometer; determine, on the basis that a part or all of data in the first group of data and a part or all of data in the second group of data meet a preset condition, that the electronic device (100, 300) is attached onto a vehicle magnetic suction bracket; and start at least one application, wherein the at least one application is a preset application or an application determined by the electronic device (100, 300) based on a preset rule, wherein the basis that a part or all of data in the first group of data and a part or all of data in the second group of data meet a preset condition comprises: determining, based on at least the part or all of data in the first group of data, that one collision occurs on the electronic device (100, 300); and determining, based on at least the part or all of data in the second group of data, that a strength of a magnetic field in which the electronic device (100, 300) is located within a preset length of time after the collision occurs on the electronic device (100, 300) is greater than a first threshold or a strength variation of the magnetic field is greater than a second threshold. determining, based on at least the part or all of data in the first group of data, that one collision occurs on the electronic device (100, 300); and determining, based on at least the part or all of data in the second group of data, that a strength of a magnetic field in which the electronic device (100, 300) is located within a preset length of time after the collision occurs on the electronic device (100, 300) is greater than a first threshold or a strength variation of the magnetic field is greater than a second threshold.