tags:

views:

57

answers:

2

I'm interested in inspecting an Intent (namely it's extras) that gets logged like this:

01-05 13:00:29.192: INFO/ActivityManager(74): Starting activity: Intent { dat=content://media/external/images/media/29 cmp=com.android.camera/.ViewImage (has extras) }

Is there any standard way to do it?
The only option I can think so far is writing a custom IntentFilter to catch it.

+2  A: 

Yeah, to be able to see the extras, a custom intent filter would be the only thing I can think of that would allow you to inspect them at runtime. You can look at the Android source to find out what extras are accepted by different activities.

CaseyB
Yeah, unless it goes like `intent = new Intent(this, ViewImage.class);`. Great we have the sources.
alex
A: 

Use something along the lines of:

Bundle bundle = intent.getExtras();
for (String key : bundle.keySet()){
 Log.d("Foo", "Extra " + key + " -> " + bundle.get(key));
}
Valentin