This library does not work completely, I do not know why and that is why I am requesting help.
It does do SOMETHING, in that it blanks out the notifcation and gives you and empty canvas, which gives me reason to believe there is some life in this log.
There is nothing shown on the notification and there is nothing in the unfiltered logs either.
Anyone who can spot something please raise an event in this thread
This requires a RelativeLayout cm.xml file to be resided as read-only in your res/layout folder.
The idea is to create a remoteview with the layout cm.xml (which warwound kindly created for me since it was so hard to make an xml file )
It does do SOMETHING, in that it blanks out the notifcation and gives you and empty canvas, which gives me reason to believe there is some life in this log.
There is nothing shown on the notification and there is nothing in the unfiltered logs either.
Anyone who can spot something please raise an event in this thread
This requires a RelativeLayout cm.xml file to be resided as read-only in your res/layout folder.
The idea is to create a remoteview with the layout cm.xml (which warwound kindly created for me since it was so hard to make an xml file )
B4X:
@ShortName("setCustomView")
public void setCustomView(BA ba, NotificationWrapper n)
{
RemoteViews rv = new RemoteViews(ba.packageName,getResourceId("layout", "cm"));
LayoutInflater mInflater = ((LayoutInflater)ba.context.getSystemService("layout_inflater"));
View container = null;
container = mInflater.inflate(getResourceId("layout", "cm"), null);
TextView text = (TextView)container.findViewById(getResourceId("id", "title"));
text.setTextColor(Colors.Black);
text.setText("Yay!");
n.getObject().contentView = rv;
}
@BA.Hide
public static int getResourceId(String type, String resourceName)
{
int ret = 0;
try
{
ret = ((Integer)GetStaticField(BA.packageName + ".R$" + type, resourceName)).intValue();
}
catch (Exception e) {
e.printStackTrace();
}
return ret;
}
@BA.Hide
public static Object GetStaticField(String classname, String fieldName) throws Exception {
Class<?> myClass = Class.forName(classname);
try {
Field field = myClass.getDeclaredField(fieldName);
field.setAccessible(true);
return field.get(null);
}
catch (Exception e) {
Class<?> superClass = myClass.getSuperclass();
if (superClass == null) {
throw e;
} else {
Field field = (Field) GetStaticField(superClass.getName(), fieldName);
field.setAccessible(true);
return field.get(null);
}
}
}
Attachments
Last edited: