Skip to content
Advertisement

Tag: android-studio

Getting “error: package androidx.core.content does not exist” when trying to build android project with FileProvider

I am relatively new to Android development, and I’m using Android Studio for development. I am trying to work with the camera for my app, and I’m trying to follow the instructions here https://developer.android.com/training/camera/photobasics. It says to use the FileProvider class, but when I try to import it, I get the error “error: package androidx.core.content does not exist” I’ve already

Using GridView in XML, getting java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView

Every time I try to start my app it crashes leaving this message in logcat Caused by: android.view.InflateException: Binary XML file line #15 in com.example.connect3game:layout/activity_main: addView(View, LayoutParams) is not supported in AdapterView Caused by: java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView This is my code: MainActivity.java activity_main.xml Answer your GridView is lacking numColumns property and also its children must

Show the current date in a Datepicker

I have two questions; my app has 2 textview datepickers, both of which I will use for a record. My problem is: 1.- How can I do so that when displaying the datepicker (the box to choose the date); the current date is selected. 2.-How can I validate the start date with the end date according to my code; or

Using “put” method of JSONObject in for loop (java)

I’m trying to use JSONObject’s put method in for loop. But I’m not getting Expected output. Expected output: OutPut I’m getting: here is my code: Answer Have you tried moving the construction of infoObj inside the loop. By having it outside, you’re maintaining state across loop iterations. I suspect you’re just updating the same json object each time and adding

unable to add Firebse to my android studio

I am trying to add firebase to my app and followed every step as told in https://firebase.google.com/docs/android/setup but as soon as a launch the app it crashes with the error I have also cross checked my gradle moudle and every thing seems to be fine, here is my gradle module Even in graple project everything seems to be ok to

SQL Insert query not storing upon button press

I am creating a project in which a database can be read and modified through an app. The tutorial for the insert section has lost me though. Using lowercase to begin a word causes a syntax error, fine. But, when capitalising the first letter it is accepted. The page then closes and takes you back to the main menu without

Advertisement