App shows black screen when minimized and reopened on Tecno android phones

19 views
Skip to first unread message

Chibuike Mba

unread,
May 16, 2017, 7:50:57 AM5/16/17
to CodenameOne Discussions
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.

Screenshot_20170516-114345.png
Screenshot_20170516-121036.png

Shai Almog

unread,
May 17, 2017, 2:03:53 AM5/17/17
to CodenameOne Discussions
Hi,
usually when that happens it means there was an exception somewhere. Please connect the device with a cable to logcat/ddms and reproduce the issue. See if there is an exception stack you can provide.
Reply all
Reply to author
Forward
0 new messages