platform/bb/rhodes/src/rhomobile/RhodesApplication.java in rhodes-2.1.0 vs platform/bb/rhodes/src/rhomobile/RhodesApplication.java in rhodes-2.2.0.beta.1
- old
+ new
@@ -50,11 +50,11 @@
import com.xruby.runtime.lang.RubyProgram;
/**
*
*/
-final public class RhodesApplication extends UiApplication implements SystemListener, ISyncStatusListener//, FileSystemListener
+final public class RhodesApplication extends RhodesApplicationPlatform implements SystemListener, ISyncStatusListener
{
// Menu Labels
public static final String LABEL_HOME = "Home";
public static final String LABEL_REFRESH = "Refresh";
public static final String LABEL_BACK = "Back";
@@ -67,10 +67,11 @@
public static final String LABEL_NONE = "none";
private static final RhoLogger LOG = RhoLogger.RHO_STRIP_LOG ? new RhoEmptyLogger() :
new RhoLogger("RhodesApplication");
+
class CKeyListener implements KeyListener{
public boolean keyChar(char key, int status, int time) {
if( key == Characters.ENTER ) {
@@ -400,10 +401,11 @@
}
void doClose(){
LOG.TRACE("Rhodes DO CLOSE ***--------------------------***");
+ onPlatformClose();
if ( _pushListeningThread != null )
_pushListeningThread.stop();
if ( ClientRegister.getInstance() != null )
ClientRegister.getInstance().Destroy();
@@ -510,10 +512,12 @@
if(!restoreLocation()) {
navigateHome();
}
+ onPlatformActivate();
+
LOG.TRACE("Rhodes end activate ***--------------------------***");
}
});
@@ -999,14 +1003,15 @@
pushScreen(_mainScreen);
createBrowserControl();
try {
RhoClassFactory.getNetworkAccess().configure();
+
} catch(IOException exc) {
LOG.ERROR(exc.getMessage());
}
-
+
PrimaryResourceFetchThread.Create(this);
LOG.INFO("RHODES STARTUP COMPLETED: ***----------------------------------*** " );
if ( com.rho.Capabilities.RUNAS_SERVICE && !m_bActivate &&
RhoConf.getInstance().getBool("activate_at_startup"))
@@ -1152,12 +1157,18 @@
_history.removeAllElements();
_history.addElement(strStartPage);
navigateUrl(strStartPage);
}
- public void close() {
- _mainScreen.close();
+ public void close()
+ {
+ this.invokeLater(new Runnable() {
+ public void run()
+ {
+ _mainScreen.close();
+ }
+ });
}
public void processConnection(HttpConnection connection, Object e)
{
// cancel previous request
@@ -1207,13 +1218,16 @@
{
LOG.ERROR("initRuby crashed.", exc);
return;
}
- if (com.rho.Capabilities.ENABLE_PUSH)
+ if ( com.rho.Capabilities.ENABLE_PUSH )
{
- _pushListeningThread = new PushListeningThread();
- _pushListeningThread.start();
+ if ( PushListeningThread.isMDSPushEnabled() )
+ {
+ _pushListeningThread = new PushListeningThread();
+ _pushListeningThread.start();
+ }
}
while( !m_bExit )
{
while(!m_stackCommands.isEmpty())