Picasso Fetching Images in Activity, then show them into Fragment's ImageView

All we need is a simple explanation of the problem, which is provided below. I am trying to fetch multiple images in an Activity with FragmentStateAdapter in it. Then I need to show them into some Fragment’s ImageView. I want to preload them into the cache ( after I receive an API response with the … Read more

How to make the an Android Vector asset for an ImageView non-transparent

All we need is a simple explanation of the problem, which is provided below. I crated a Vector asset using Android studio and I have the following code: <vector android:height="24dp" android:tint="#4CAC78" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M23,12l-2.44,-2.78 0.34,-3.68 -3.61,-0.82 -1.89,-3.18L12,3 8.6,1.54 6.71,4.72l-3.61,0.81 0.34,3.68L1,12l2.44,2.78 -0.34,3.69 3.61,0.82 1.89,3.18L12,21l3.4,1.46 1.89,-3.18 3.61,-0.82 -0.34,-3.68L23,12zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z"/> </vector> The result looks like … Read more

What "Icon Type" should I choose for normal images to be used in an Android app? How should I add these as ImageViews?

All we need is a simple explanation of the problem, which is provided below. I want the images to be as they are, without any changes. I’m trying to add some images provided by Android Studio by default (Asset Type: Clip Art). The images will be used as ImageViews in the app’s main screen and … Read more

Display elements in the same place for all devices

All we need is a simple explanation of the problem, which is provided below. I’m trying move items bottom middle, and I want that it was on bottom middle for all devices. And I need add text above and under my imagviews on middel. Sorry for trivial question. This is my code in Android Studio. … Read more

How To Fit Number of ImageViews Inside RecyclerView?

All we need is a simple explanation of the problem, which is provided below. I have a RecyclerView with a fixed Dimension-Ratio <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" …> <androidx.recyclerview.widget.RecyclerView android:layout_width="0dp" android:layout_height="0dp" android:orientation="horizontal" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layout_constraintDimensionRatio="35:16" … /> </androidx.constraintlayout.widget.ConstraintLayout> I Need to show list of ImageView inside the RecyclerView, but with a fixed number of images shown on the … Read more

Why can't you change srcCompat of an Imageview directly?

All we need is a simple explanation of the problem, which is provided below. I am following the Kotlin Android tutorial and am currently on the Dice Roller App tutorial. For changing the image, the tutorial says to write: diceImage.setImageResource(drawableResource) My question is, why can’t we change the image directly? Like say: diceImage.srcCompat = drawableResource … Read more

How to set tint for an text view programmatically in android?

All we need is a simple explanation of the problem, which is provided below. I am trying to set the tintList programatically in the Android app for both imageView and textView. The code works for imageView but dosent work for textView. I have tried using the following code. //Defining myColorStateList myColorStateList = new ColorStateList( new … Read more

Android onClickListener NullPointerException

All we need is a simple explanation of the problem, which is provided below. all. I’ve searched, but can’t find anything that helps me fix this problem. My app quits almost immediately on launch due to a NullPointerException. I suspect maybe the problem is that I’m using a drawable image (ImageView) rather than a button … Read more

Setting image from url to ImageView with AsynchTask

All we need is a simple explanation of the problem, which is provided below. I have an image on my website, that I want to set on my ImageView. Do to that I needed to use an asynch task. I’m doing it like below. But new getThumbnail().execute(stringThumbnail); is throwing me the error getThumbnail cannot be … Read more