LIFE_AI
(AI LIFE)
1
activity starter extra only support string or array, do not support int or boolean, with minimal modification it can be added
if (value instanceof YailList) {
Log.i(LOG_TAG, "Adding extra list, key = " + key + " value = " + value);
intent.putExtra(key, ((YailList) value).toStringArray());
}
else {
String stringValue = castExtra.getString(1);
Log.i(LOG_TAG, "Adding extra string, key = " + key + " value = " + stringValue);
intent.putExtra(key, stringValue);
}
then try this
if (value instanceof YailList) {
Log.i(LOG_TAG, "Adding extra list, key = " + key + " value = " + value);
intent.putExtra(key, ((YailList) value).toStringArray());
}
else if (value instanceof Integer) {
Integer intValue = (Integer) value;
Log.i(LOG_TAG, "Adding extra int, key = " + key + " value = " + intValue);
intent.putExtra(key, intValue);
}
else if (value instanceof Boolean) {
Boolean boolValue = (Boolean) value;
Log.i(LOG_TAG, "Adding extra boolean, key = " + key + " value = " + boolValue);
intent.putExtra(key, boolValue);
}
else {
String stringValue = castExtra.getString(1);
Log.i(LOG_TAG, "Adding extra string, key = " + key + " value = " + stringValue);
intent.putExtra(key, stringValue);
}
from the extensions directory App Inventor Extensions | Pura Vida Apps
Activity Starter Extension by pepemont, which additionally is able to pass boolean and long values, updated version by Sergio
Taifun
1 Like
LIFE_AI
(AI LIFE)
4
not working, need to use this
else if (value instanceof gnu.math.IntNum) {
Integer intValue = ((gnu.math.IntNum)value).intValue();
intent.putExtra(key, intValue);
Log.i(LOG_TAG, "Adding extra Int, key = " + key + " value = " + intValue);
}
system
(system)
Closed
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.