encounter a problem today, in the music app Long press A song, select Search in the pop-up menu, select the browser in the Search selection box. Normally you should open the browser and start the search using the default search engine, but now the browser search interface is not open. The first thought is to open the browser project, set breakpoints in the relevant location, start debugging, found that everything is working properly, the browser interface opens and normally starts the search process. The original problem only occurs when the browser process has not started, and the music app uses Intent to launch the browser to search for the case. Here's how to start debugging analysis in this case.
first, the application is used by other applications Intent started, and we need to debug it. when debugging the program in C/s + +, we typically debug the debugger as attach to a given process number, in fact ADT supports this scenario: Open browser APK Project, open ddmsperspective, if the current browser is already running, in the Devices view click your app, this time Devices view of the green Bug button will become Active State, click on it to Attach to the process for debugging,
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/28/3F/wKioL1N2wFHgHzhSAAHenyIkFUc642.jpg "title=" Browser. png "alt=" wkiol1n2wfhghzhsaahenyikfuc642.jpg "/>
second, your app may end soon after it's started, and you haven't had time to Attach to it ( your breakpoint does not work before Attach to it). You need your application to wait for you, so that you can attach it in time . The easiest way to do this is to Sleep before your breakpoint , or use a different synchronization scheme (in traditional applications we usually read a keyboard input to synchronize).