Skip to content
Advertisement

Tag: android-studio

How do I hide a NativeAdView ad template?

How can I hide where the ad appears if there is no ad? This is the advertisement that I have. It works and there is no problem, but in the event that there is no advertisement, the template remains. I want it to disappear and appear only when an advertisement is available enter image description here NativeAdView template Answer control

How to set text color of bottom navigation item selection and unselection?

I was trying to set the following attribute of BottomNavigationView widget But this sets the text color of active and inactive item both. I want to have different text color on active and inactive item of BottomNavigationView. Answer First, you have to make a selectable color in res>color>selectable_color Then you have to set this selectable color as itemTextColor in BottomNavigationView

Type com.example.myhouse.MainActivity is defined multiple times

Error while compiling the code. Type com.example.myhouse.MainActivity is defined multiple times: C:UsersHPAndroidStudioProjectsmyHouseappbuildtmpkotlin-classesdebugcomexamplemyhouseMainActivity.class, C:UsersHPAndroidStudioProjectsmyHouseappbuildintermediatesjavacdebugclassescomexamplemyhouseMainActivity.class Gradle file Answer Just delete build folder of appmodule and Rebuild the project! or Try to invalidate cache and restart This will fix the issue!.

My RecyclerView duplicates my items views

So I’m testing the Recycler View and facing some troubles when adding new item. I have a RecyclerView where I try to display a user’s contacts, but when I create a new elemen, all the contacts duplicate. I know that I should clean my view before adding new data, but I’m not sure how to do that. Here’s my main

Advertisement