We would like to know if it is possible to get the context of Duksecript Android presenter so we can call external elements?
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
final ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.bluetoothSettings");
intent.setComponent(cn);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity( intent);
or
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.setAction(Intent.ACTION_VIEW);
intent.setData(path);
intent.setType("application/pdf");
startActivity(intent);
would this be possible short of changing the presenter to suit our needs?
Thanks in advance.
Sorry for the late answer. You don't need to change the presenter. By default DukeScript provides you an activity which handles everything behind the scene automatically. But you can also create a decorating activity that has access to all Android services. E.g.:
You’ll also need to register this Activity in your AndroidManifest.xml, e.g. like this:
https://dukescript.com/best/practices/2015/11/20/AndroidBoot.html