While there is no way to add entry points at runtime, there IS a way to launch your application with arguments.
This will likely achieve what you want. To do so you can try this:
Code:
ApplicationManager.getApplciationManager().launch( "YourModuleName?arg0&arg1&arg2..." );
// then in main ...
public static void main( String[] args ) {
String arg0 = args[0];
String arg1 = args[1];
...
}
When you enter the main function, you must be sure to check if you already have an instance of the app running so that you don't call enterEventDispatcher on more than one instance of your app.
You can do so by doing this:
Code:
RuntimeStore appReg = RuntimeStore.getRuntimeStore();
Object instance = null;
synchronized( appReg ) {
instance = appReg.get( APP_ID );
if ( instance == null ) {
// you're safe to enter the event dispatcher
// register your instance in the runtime store
instance = new MyApplication();
appReg.put( APP_ID, instance );
instance.enterEventDispatcher();
}
else {
// Parse your "special" arguments
}
}
Where APP_ID is some constant int that you define.
However, if all you want is to allow the user to change the icon, then why not use the Homescreen API and the persistent store to persist a Bitmap object in the case of device restarts?