MCPcopy Create free account
hub / github.com/M66B/FairEmail / getWho

Method getWho

app/src/main/java/eu/faircode/email/Helper.java:1991–2007  ·  view source on GitHub ↗
(Fragment fragment)

Source from the content-addressed store, hash-verified

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);

Callers 2

updateListStateMethod · 0.95
getRequestKeyMethod · 0.95

Calls 4

wMethod · 0.95
indexOfMethod · 0.80
getMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected