Questions tagged android

Explore the latest questions and answers asked by our top developers.

Why does the imageButton not getting accurately placed here?

I am trying to place an imageButton (imagebutton4) here like this (in top left): And here is the XML for this: <ImageView android:id="@+id/imageView5" android:layout_width="150dp" android:layout_height="193dp" android:layout_marginStart="6dp" android:text="TextView" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/imageView6" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <ImageButton android:id="@+id/imageButton" android:layout_width="50dp" android:layout_height="50dp" app:layout_constraintBottom_toBottomOf="@+id/imageView5" app:layout_constraintEnd_toEndOf="@+id/imageView5" app:layout_constraintStart_toStartOf="@+id/imageView5" app:layout_constraintTop_toTopOf="@+id/imageView5" app:srcCompat="@drawable/play" tools:ignore="SpeakableTextPresentCheck" /> <TextView android:id="@+id/textView3" android:layout_width="134dp" android:layout_height="28dp" android:text="TextView" app:layout_constraintBottom_toBottomOf="@+id/imageView5" app:layout_constraintEnd_toEndOf="@+id/imageView5" app:layout_constraintHorizontal_bias="0.511" app:layout_constraintStart_toStartOf="@+id/imageView5" app:layout_constraintTop_toBottomOf="@+id/imageButton" app:layout_constraintVertical_bias="0.29000002" […]

By john doe
Published
Categorized as android, android-constraintlayout

Saving TTS audio files to shared storage in android 10

I want to save my audio file to shared storage in android 10 which is created using : textToSpeech.synthesizeToFile(text,params,file,"utterance_id"); file is of ParcelFileDescriptor type which is created using createFile() method: public void createFile() { ContentValues values = new ContentValues(4); values.put(MediaStore.Audio.Media.TITLE, "Audioasas"); values.put(MediaStore.Audio.Media.DATE_ADDED, (int) (System.currentTimeMillis() / 1000)); values.put(MediaStore.Audio.Media.MIME_TYPE, "audio/mp3"); values.put(MediaStore.Audio.Media.RELATIVE_PATH, "Music/Recordings/"); audiouri = getContentResolver().insert(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, values); try […]

By Kartik Thakur
Published
Categorized as android, android-10.0, android-studio, java, text-to-speech

RecyclerView displaying only first index of three

i have a weird problem, I am trying to create a simple app, but i got stuck with recycleview and displaying items. My problem is that i get only one text from the total three. getItemCount() says that i have 3 items … so i don’t know why i get display of only 1 instead […]

By Marius Nicolae
Published
Categorized as android, android-recyclerview, java

Retrieve data from Realtime Database in fragment recyclerview

When I send data to realtime database. it generates 1…5…… numbers as ID with this code: private fun newpost() { var id = 1 buttonPost.setOnClickListener() { dataa.child(auth.currentUser?.uid!!).get().addOnSuccessListener { if (it.exists()) { val imageUrl = it.child("photoUrl").value val postText = editTextNewPost.text.toString() if (postText.isNotEmpty()) { data.child(id.toString()).child("title").setValue(postText) data.child(id.toString()).child("imageUrl").setValue(imageUrl.toString()) editTextNewPost.setText("") id += 1 Toast.makeText(activity, "Post Added", Toast.LENGTH_LONG).show() } } } […]

I got stuck here . Every time i try to run the app it crashes [duplicate]

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.offbeat, PID: 19140 java.lang.RuntimeException: Failure delivering result ResultInfo{[email protected]:requestPermissions:, request=42, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {com.example.offbeat/com.karumi.dexter.DexterActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.widget.ListView.setAdapter(android.widget.ListAdapter)’ on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:5195) at android.app.ActivityThread.handleSendResult(ActivityThread.java:5236) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2187) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:8057) […]

By Biswajit Ghosal
Published
Categorized as android, android-studio, java

Flutter Quill in a Scrollview produces exception errors with certain actions (iOS and Android)

There is an issue when pasting text using the press and hold method in iOS. This produces the following error: Failed assertion: line 107 pos 12: ‘_positions.isNotEmpty’: ScrollController not attached to any scroll views. When selecting a word and then moving the start or end handles to extend the selection it will produce this error […]

By Steve
Published
Categorized as android, flutter, ios, quill

Braintree simple Info [closed]

as the title says, I need information about "Braintree". What information am I looking for? I only need information about their commissions, although in PayPal they report that this is an extension and that they have the same commissions as PayPal, the information regarding their commissions is null or non-existent. In short, all I need […]

By Bones ipsilon
Published
Categorized as android, braintree, java, paypal

Android build failed with ‘parser.name must not be null’

In an Android project, build failed with this error: > Task :app:generateSafeArgsDebug FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:app:generateSafeArgsDebug’. > parser.name must not be null Source: Android Questions

By nico
Published
Categorized as android, android-jetpack-navigation, gradle

react-native-svg is either no Android app project or build version has not been set

I upgraded some dependencies for my react native project now I’m getting the following error when I try to build android. Can anyone tell me what I"m doing wrong? > Configure project :react-native-svg Project react-native-svg at :react-native-svg is either no Android app project or build version has not been set to override. Skipping… FAILURE: Build […]

By Dan Ramos
Published
Categorized as android, react-native

Change activity in a navigation Drawer with Fragment and FragmentActivity

I am a newbie programmer and I am trying to learn something of Android. I follow some tutorials and now I have a navigation Drawer App. Until now I have managed changes of layouts with the buttons in the menu. Now I want to create a map locator and I followed this Tutorial. Now I […]

By newbieprog
Published
Categorized as android, firebase, java
1 2 3 14,351

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq