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
Tag: android
How can i pass values from sqlite database to viewpager?
There is my model. (Card with two questions) This is my Activity. Adapter pass values from ArrayList to the ViewPager. In this class I create DataBase and try to pass values from cursor to ArrayList in MainActivity, but, when I start to debug, the debugger shows me that ArrayList in MainActivity is not filled with values. What I should do
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.
How to get latitude and longitude separately in 2 textviews in android studio JAVA?
from this i’m getting latitude and longitude in a single textview. But I want the latitude to be in 1 textview and longitude in another text view. Please help me on this. My main activity my geocodinglocation class.java from this i’m getting latitude and longitude in a single textview. But I want the latitude to be in 1 textview and
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
How to change an already generated project language from Kotlin to Java in Android Studio?
I created a project using kotlin as the prefer language but for some reasons I want to use java. I don’t want to create this project over. Answer Just create a file with extension .java and work on that
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
Main Adapter Cannot be Applied to Java List
(list , this)<= this Line Creates Problem. This is my Main Acitivty Code Main Adapter Code This one is Main Model Answer Here, In your code, you are missing a constructor as mentioned by @Sergey as well as you are passing the wrong context in onCreateViewHolder().You should pass parent.getContext();
How to update the value of the existing columns in SQLite android ? (not able to do in my project)
I am trying to update the existing column of my table but am not able to do so…. There are no errors it is just not getting updated. My code are there below Calling the function by passing value a is the _id in which i want to change and i is the value which i want to insert. The
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.