This question already has answers here:
Android App activities installed as multiple icons
(3 answers)
Closed 1 year ago.
My main activity has a button that opens the Libgdx game, which was what I wanted, but when I test the app on my phone or on the emulator, two application icons appear. One of them opens the game directly, the other one is the main app that contains the button that starts the game class.
Is there a way to hide one of them? Or what is the proper thing to do? I could not find any information on the internet.
I found the solution: Android App activities installed as multiple icons
I had an extra
<category android:name="android.intent.category.MAIN" />
Related
This question already has answers here:
Where is main() in Android?
(9 answers)
Closed 4 years ago.
A Java program execution starts from main() method. Right? Since Android apps run on Java, Then why we didn't create a main() method in Android studio?
There's one, but you don't need to see it. Android takes care of threading and keeping threads organized for you, see here.
Moreover, the entry point for an activity is the onCreate() method, so all initialization is normally done in there. The first activity run by your app is normally specified in the manifest file under the launcher keyword.
See here to know more about how android runs the launcher activity.
This question already has answers here:
Disable Button click sound in android
(4 answers)
Closed 6 months ago.
I can't find in our segment of the Internet this decide.
I work on Android game, and I can't disable click sound on application level, when the user click on clickable elements: buttons, imageViews etc.
But I know that I can do this using smartphone menu, but this solution not good.
Then, how I can disable this sounds using android studio code?
Thanks for your all answers and your wasted time!
you just have to add this line off code to disable the sound
Button.setSoundEffectsEnabled(false);
This question already has answers here:
How to allow users to check for the latest app version from inside the app?
(12 answers)
Closed 8 years ago.
I am developing a real-time multiplayer game with Google play game services. In order to avoid situations where two players with different app versions try to play with each other I would like, on every app start, the app to check if there is an update on Google play and not let the user continue until he updates the app to the latest version.
You should trust Google Play in updating your app, and you should not duplicate it work.
What you should do - you must develop your game to allow normal playing with "minus 1" or even "minus 2" versions.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to disable Mobile Data on Android
I'm sorry for my English, I use a translator.
In the android menu, you can turn off mobile data in the background. How can I do this using code?
You as a programmer are responsible for the behaviour of your program, so if you don't want that your program uses data when in the background:
Test for it.
When in background, don't make call's.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to change current Theme at runtime in Android
Hi so I'm nearing the completion of my first app and now there are just some things I'd like to add in for user interface for instance the current mms app I have on my droid is a modded stock one where it has in the settings a check box to change the apps theme between black and white.
I was wondering if someone could show me how to do that or at least point me in the right direction. I've read a few guides on adding check boxes to my app so that's no problem its the actual change how do I put in the code both themes and then set the app to look at one or the other based on the selection of the check box.
Thank you for any input and help.
Call Activity.setTheme() in onCreate, before you set up your layout.