Peters_
Peters_

Reputation: 647

How to debug an application in Android, that is started by opening a file?

I would like to debug an application in Android when I open a file and choose open using my app (e.g. pdf file and my app is able to read pdf). Is it possible?

I tried adding Thread.sleep to launcher activity and attaching debug to running process, but the app crashes.

Regards, Piotr

Upvotes: 0

Views: 56

Answers (2)

isma3l
isma3l

Reputation: 3853

You can use Debug.waitForDebugger(); just before opening the file and attach a debbuger then.

Look http://developer.android.com/intl/es/reference/android/os/Debug.html#waitForDebugger%28%29

Upvotes: 4

tiny sunlight
tiny sunlight

Reputation: 6251

Don'r run and attaching debug to running process.Directly debug.

Upvotes: 0

Related Questions