Hi all, I'm using RemoteViews and reflection to access its subclass
ReflectionAction and get the text of the notifications in the top bar and
is working well. In all versions except the 4.2 class has three fields are:
value, type and viewId, which are those that use, but in 4.2 viewId field
does not exist, it appears that a change in the definition of the class but
then I can not identify which is every text.
Any idea how to retrieve it?
Here the code:
Field innerFields[] = reflect.getClass().getDeclaredFields();
Object value = null;
Integer type = null;
Integer viewId = null;
//ReflectionAction class fields
for (Field field : innerFields) {
field.setAccessible(true);
if (field.getName().equals("value")) {
value = field.get(action);
} else if (field.getName().equals("type")) {
type = field.getInt(action);
} else if (field.getName().equals("viewId")) {
//Here at Android 4.2 smartphones never enters and viewId always is null
viewId = field.getInt(action);
}
}
Greetings
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en