Category "android-layout"

One Android project two java file & res file

I took this from another resource but I have two java files and a res file I could not understand very well. Are these two files necessary?

java.lang.IllegalStateException: view!!.findViewById(R.id.dog_image) must not be null

I am working with Android Studio and Kotlin. I am trying to create an RecyclerView and a Adapter. I obtain the following error when I try to use the RecyclerVie

what should be the size of Drawer Header Image?

public DrawerProfile(Context context) { super(context); HeaderImageView = new ImageView(context); HeaderImageView.setVisibility(VISIBLE

Popup menu goes out of the screen

Popup menu on inflate goes out of the screen for this activity, works fine for other Extending custom AppCompatActivity Styles: <style name="AppTheme.Ac

rich link preview in android

I am working on an application where I think rich link preview (whatsapp supports it,refer image) will be helpful for users but I am not able to get an idea to

Android status bar is the same color as Toolbar

I am running an android project. My toolbar and status bar are all green in my activity_main layout. If i change toolbar color to other color the status bar wil

How to remove Header title in bottom nav bar - Android Studio

My objective is removing the orange bar thar has the label "App name". Currently I have a top_app_bar and bottom_nav_bar. As far as I know the orange bar is gen

Android databinding set padding if value is true

I want to be able to to be able to set padding values if a boolean is true. The problem is that Android studio cannot parse the layout because it thinks 2dp is

How to have EditText with border in Android Lollipop

I am developing an Android app. I need to know how we can have a EditText with border. In Lolipop they have completely changed the EditText style. Can we do it

How to align to right on the same column in android layout

I have 2 text view and i want them to align horizontally at the same column. I tried to android:layout_toRightOf="@id/textName" but it seem like it goes to t

Error inflating class com.andexert.expandablelayout.library.ExpandableLayout

Im getting this error android.view.InflateException: Binary XML file line #12: Error inflating class com.andexert.expandablelayout.library.ExpandableLayout E/A

how to make full screen activity with status bar on top of it while scrollbar is not scrolling full in Activity when it focus on editText?

Issue is that when I enter text in EditText then ScrollView does not work and does not scroll in my activity fun statusBarColor(activity: Activity) {

how to make full screen activity with status bar on top of it while scrollbar is not scrolling full in Activity when it focus on editText?

Issue is that when I enter text in EditText then ScrollView does not work and does not scroll in my activity fun statusBarColor(activity: Activity) {

View in the view pager overlap between previous and next view

I am using ViewPager for sliding effect in my app. I have pager.setPageMargin() to make next and previous views visibility, unfortunately my next view is over

How to use wrap_content with a maximum width?

I am trying to layout a view that should wrap its content, but it shouldn't be more than ~100dp less than its parent width. How can I do that using a RelativeLa

How to add Toolbar on Translucent imageview

I need to know, How we can create an toolbar on this imageview just with back button(getSupportActionBar().setDisplayHomeAsUpEnabled(true);). Here is the exampl

Android button position fixed to bottom until scroll to its parent layout position

I want to add a button to my layout which is fixed to bottom in the screen until user scroll and come to its proper location in the parent layout. Here the butt

Change color of Floating Action Button from Appcompat 22.2.0 programmatically

I would like to know how to change the Floating Action Button color from the Support library 22.2.0 ? I've tried button.setBackgroundColor(color); but clear

RecyclerView: Inconsistency detected. Invalid item position

Our QA has detected a bug: when rotating the Android device (Droid Turbo), the following RecyclerView-related crash happened: java.lang.IndexOutOfBoundsExce

Android Nougat: TextureView doesn't support displaying a background drawable

I have been using a TextureView in my android app, and it was working fine. Just recently I tested my code on an Android device with Android API 25 (7.1.2). Sam