How do you create an Activity based applications with no UI?
The answer is that you need to set the activity theme in the manifest, for RosieUtility I use:
Like this in AndroidManifest.xml:
<activity android:name=".MainActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
If you just want to kick off something quick, you’ll also want to call “finish();” after firing the intent in onCreate of Activity
The latest set of activity themes are defined in /res/values/themes.xml in the Android source here.
Note I’m not using the theme ‘NoDisplay’ as I do actually show notifications on the screen as the Activity is going about its business.