01-22-2013 06:44 AM
Hi,
I have an application that works correctly with API 5.0, but does not start if I compile and run it with API 7.0. If I try to click on the application icon I can read in the console of Eclipse this message:
Foreground app MY_APP_PACKAGE ignoring touchsc[0.0] reen touch/click because it has no target screen.
Can you tell me the meaning of this message? I think this is the problem... This is the main of the app (I've an alternate entry point with application argument "init", home screen position "0", auto-run on startup checked and startup tier "7").
public class MyApp extends UiApplication {
public static void main(String[] args) {
if (args != null && args.length > 0 && "init".equals((String) args[0])) {
Timer timer = new Timer();
timer.schedule(new MyTimerTask(), Constants.TimerThread.DELAY_START, Constants.TimerThread.INTERVAL);
} else {
MyApp theApp = new MyApp (false);
theApp.enterEventDispatcher();
}
if (ApplicationManager.getApplicationManager().inStar tup()) {
MyApp theApp = new MyApp (true);
theApp.addFileSystemListener(new MyAppFileSystemListener(theApp));
theApp.enterEventDispatcher();
}
}
public MyApp (boolean startup) {
if (ApplicationManager.getApplicationManager().inStar tup()) {
registerListener();
PersistentObject persistentObject = PersistentStore.getPersistentObject(Constants.Pers istent.VENDITORE_ID);
persistentObject.setContents((Venditore) null);
persistentObject.commit();
PersistentObject persistentLog = PersistentStore.getPersistentObject(Constants.Pers istent.LOG_ID);
persistentLog.setContents((Boolean) Boolean.TRUE);
persistentLog.commit();
PersistentObject persistentLockPim = PersistentStore.getPersistentObject(Constants.Pers istent.LOCK_PIM_ID);
persistentLockPim.setContents((Boolean) Boolean.TRUE);
persistentLockPim.commit();
PersistentObject persistentShowOptions = PersistentStore.getPersistentObject(Constants.Pers istent.SHOW_OPTIONS_ID);
persistentShowOptions.setContents((Boolean) Boolean.FALSE);
persistentShowOptions.commit();
PersistentObject persistentSync = PersistentStore.getPersistentObject(Constants.Pers istent.SYNC_ID);
persistentSync.setContents((Boolean) Boolean.TRUE);
persistentSync.commit();
PersistentObject persistentTodo = PersistentStore.getPersistentObject(Constants.Pers istent.TODO_ID);
persistentTodo.setContents((String) null);
persistentTodo.commit();
EventLogger.register(Constants.Persistent.EVENT_LO GGER_ID, Constants.Application.TITLE_APP, EventLogger.VIEWER_STRING);
} else {
if (!startup) {
if (!Util.isSDCardMounted()) {
Util.logDebug("SDCard non montata");
pushScreen(new Dialog(Dialog.D_OK, Constants.System.NO_SDCARD_DETECTED,
0, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Dialog.FIELD_HCENTER));
} else {
// Il push dello screen si fa solo se non siamo nella fase di startup
pushScreen(new MyAppMainScreen());
}
}
}
}
public void registerListener() {
PIM p = PIM.getInstance();
try {
BlackBerryEventList eventList = (BlackBerryEventList) p.openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
eventList.addListener(new SFAPimListener());
} catch (PIMException e) {
// Can't add listener
Util.logError("Errore durante la registrazione del listener " +
"relativo alla modifica di eventi sull'agenda" +
"nativa del BlackBerry", e);
}
MyMenu menu = new MyMenu ();
ApplicationMenuItemRepository.getInstance().addMen uItem(ApplicationMenuItemRepository.MENUITEM_CALEN DAR, menu);
}
/* public void batteryGood() {
// TODO Auto-generated method stub
}
public void batteryLow() {
// TODO Auto-generated method stub
}
public void batteryStatusChange(int status) {
// TODO Auto-generated method stub
}
public void powerOff() {
// TODO Auto-generated method stub
}
public void powerUp() {
// TODO Auto-generated method stub
} */
}Thanks in advance.
Regards,
Gianni.
01-22-2013 07:00 AM
01-22-2013 08:39 AM - edited 01-22-2013 10:38 AM
I agree with Simons comments, my experience is that OS 5.0 apps will run in OS 7.0, and debugging should sort out where your problem.
That said, there are cases where things that were let go in OS 5.0 were stopped in OS 6.0 and later. In this case I suspect your start up processing falls into that category. I would review what you have in there, and compare it with the following KB article. I think you can re-write it to simplify it and I think it may overcome some of your start-up issues.
http://supportforums.blackberry.com/t5/Java-Develo
Edit: link corrected....
01-22-2013 09:47 AM
Thank you very much. Can you give the link to the KB? I try to search that article but I didn't find it...
01-22-2013 10:38 AM
Aoppss sorry, link corrected....