Hi everyone, my app is showing black screen when minimized and reopened on Tecno android phone with custom OS (HiOS) but works well on other brands we have tested on.
Main class:
package com.xdplax.playsafe;
import com.codename1.notifications.LocalNotificationCallback;
import com.codename1.ui.Display;
import com.codename1.ui.Form;
import com.codename1.ui.Dialog;
import com.codename1.ui.FontImage;
import com.codename1.ui.plaf.UIManager;
import com.codename1.ui.util.Resources;
import com.codename1.ui.plaf.DefaultLookAndFeel;
import com.codename1.ui.plaf.Style;
import com.xdplax.playsafe.model.Reminder;
import com.xdplax.playsafe.model.Settings;
import com.xdplax.playsafe.ui.HomeScreen;
/**
*
* @author CHiBEX
*/
public class PlaySafe implements LocalNotificationCallback {
private Form current;
private Resources theme;
public void init(Object context) {
theme = UIManager.initFirstTheme("/theme");
new Reminder().getPropertyIndex().registerExternalizable();
new Settings().getPropertyIndex().registerExternalizable();
Style s = new Style();
s.setFgColor(0xe91e63);
s.setBgTransparency(0);
((DefaultLookAndFeel) UIManager.getInstance().getLookAndFeel()).
setComboBoxImage(FontImage.createMaterial(FontImage.MATERIAL_ARROW_DROP_DOWN, s, 5F));
}
public void start() {
if(current != null){
current.show();
current.forceRevalidate();
return;
}
HomeScreen homeScreen = new HomeScreen();
homeScreen.show();
}
public void stop() {
current = Display.getInstance().getCurrent();
if(current instanceof Dialog) {
((Dialog)current).dispose();
current = Display.getInstance().getCurrent();
}
}
public void destroy() {
}
@Override
public void localNotificationReceived(String notificationId) {
theme = UIManager.initFirstTheme("/theme");
Dialog.show("Noti", notificationId, "OK", null);
System.out.println("Received local notification "+notificationId);
}
}
One of the attached screenshots shows the app in good condition while the other shows the black screen.
Please your assistance is highly appreciated.