diff --git a/droidbot/device.py b/droidbot/device.py index a50f982..5fa5cc2 100644 --- a/droidbot/device.py +++ b/droidbot/device.py @@ -504,7 +504,7 @@ def get_top_activity_name(self): Get current activity """ r = self.adb.shell("dumpsys activity activities") - activity_line_re = re.compile('\* Hist #\d+: ActivityRecord{[^ ]+ [^ ]+ ([^ ]+) t(\d+)}') + activity_line_re = re.compile(r'\*\s*Hist\s*#\d+:\s*ActivityRecord\{[^ ]+\s*[^ ]+\s*([^ ]+)\s*t(\d+)}') m = activity_line_re.search(r) if m: return m.group(1)