Skip to content
Advertisement

Tag: android

Android combine multiple booleans with elements from List

Hello I am developing a game and working on collision detection. For now my method does not allow to add elements dynamically, as you can see I am adding collision nodes (11,12,13,…) manually. Here is my code: I want to dynamically build a boolean isNotCollision() depending on number of elements of collision in List. I want to rebuild it in

Bundle is null when starting an activity from a listener using intent

The bundle is null when I use this code. The Logcat shows: MyListenerService.java MainActivity.java I have this working in a similar module of another project and have been comparing them. The only notable difference is that the working MainActivity extends Activity, and this one extends AppCompatActivity. I looked at this, but code seems consistent as it does use a bundle.

Android date is incorrect

I am using Calendar class to get year, month and day: Today is 11 Dec 2021 (2021-12-11). But toast alert shows 2021-11-11. Also I tried to set calendar time to a new Date class but still wrong Answer tl;dr I am using Calendar class Don’t. Use only java.time classes. 2021 Details The Answer by Modi is correct. Furthermore, never use

Working on Android Music Player Project, and ran into the issue where my app crashes on start up:

I am trying to add a player using Sliding Up Panel but the app crashes on startup. If you want to see my full code; https://github.com/Kailash8460/poptune.git MainActivity.java activity_main.xml MainFragment.java Here there is no issue on SongsFragment, ArtistFragment and AlbumFragment files, because I have run this application before adding the sliding up panel and that was successfully run but after adding

Cometd with Android: java.lang.RuntimeException: Could not find an implementation class

I am trying to implement a cometD client in a Kotlin Multiplatform App for android at the moment. Here are my android dependencies My code (CometdConnection.kt) The app gets compiled but crashes when the initialization fails with an error Answer You don’t need dependency org.cometd.java:cometd-java-client-websocket-javax:7.0.5 because you already have org.cometd.java:cometd-java-client-websocket-okhttp:7.0.5. Remove it and the error should go away.

Advertisement