As per this post, I know I am allowed to create an activity that has no user interface by declaring your activity like below:
<activity
android:name=".NoUIActivity"
android:theme="@android:style/Theme.NoDisplay">
</activity>
My problem is NoUIActivity extends AppCompatActivity. If I use the android:theme
line above, it gives me error saying I should use the corresponding AppCompat theme. Help please. Thanks!
Your activity should look like:
public class NoUIActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.activity_no_uiactivity);
}
}
And in AndroidManifest.xml declare activity like:
<activity
android:name=".NoUIActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="false" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With