(Fragment fragment)
| 1989 | } |
| 1990 | |
| 1991 | static String getWho(Fragment fragment) { |
| 1992 | String who; |
| 1993 | try { |
| 1994 | Class<?> cls = fragment.getClass(); |
| 1995 | while (!cls.isAssignableFrom(Fragment.class)) |
| 1996 | cls = cls.getSuperclass(); |
| 1997 | Field f = cls.getDeclaredField("mWho"); |
| 1998 | f.setAccessible(true); |
| 1999 | return (String) f.get(fragment); |
| 2000 | } catch (Throwable ex) { |
| 2001 | Log.w(ex); |
| 2002 | String we = fragment.toString(); |
| 2003 | int pa = we.indexOf('('); |
| 2004 | int sp = we.indexOf(' ', pa); |
| 2005 | return we.substring(pa + 1, sp); |
| 2006 | } |
| 2007 | } |
| 2008 | |
| 2009 | static String getRequestKey(Fragment fragment) { |
| 2010 | return fragment.getClass().getName() + ":result:" + getWho(fragment); |
no test coverage detected