【发布时间】:2011-08-21 23:20:58
【问题描述】:
编辑:使用更简单的代码。 我有一个黑莓应用程序,直到最近(我在我的手电筒上升级到 6.0.0.600)可以被删除。现在,即使我使用 javaloader -u erase(正在使用的模块)并且 UI 上下文菜单或物理菜单没有删除选项,我也不能。下面的代码只需要一个应用程序描述符,在启动时带有一个备用入口点,参数为“startVibrate”。入口点代码如下。
package mypackage;
import net.rim.device.api.system.Alert;
import net.rim.device.api.system.ApplicationDescriptor;
import net.rim.device.api.system.ApplicationManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.UiApplication;
/**
* This class extends the UiApplication class, providing a
* graphical user interface.
*/
public class ScheduleAppDemo extends UiApplication
{
public static void main(String[] args)
{
if (args != null && args.length > 0 && "startVibrate".equals(args[0]))
{
scheduleVibrate();
}
else
{
ScheduleAppDemo app = new ScheduleAppDemo();
app.enterEventDispatcher();
}
}
public ScheduleAppDemo()
{
ScheduleAppDemoScreen screen = new ScheduleAppDemoScreen();
pushScreen(screen);
}
public class ScheduleAppDemoScreen extends MainScreen
{
public ScheduleAppDemoScreen()
{
setTitle("Schedule app demo");
}
}
private static void scheduleVibrate()
{
Alert.startVibrate(2550);
ApplicationDescriptor current = ApplicationDescriptor.
currentApplicationDescriptor();
current.setPowerOnBehavior(ApplicationDescriptor.DO_NOT_POWER_ON);
ApplicationManager manager = ApplicationManager.getApplicationManager();
manager.scheduleApplication(current, System.currentTimeMillis()
+ 60000, true);
}
}
基本上,这向您展示的是它每分钟都在振动。不幸的是,证据表明应用程序管理器似乎在这段时间内保持后台进程运行,然后在再次运行时再次调用它。这是来自 RIM 的示例应用程序。删除 Application descriptor.xml 中的所有备用入口点允许删除应用程序。除了修改它,重新加载代码,然后删除它;如何删除应用程序。
【问题讨论】:
标签: blackberry java-me