Skip to main content

Questions tagged [android-inflate]

Instantiates a layout XML file into its corresponding View objects

android-inflate
0 votes
0 answers
23 views

Inflate and menu.xml don't work as expected

this is my java fileI follow to write this code with a android development course online, but don't know why it doesn't work. [this is my menu.xml file, (https://i.sstatic.net/xyC8G.png)] Can anyone ...
Phyo Aung's user avatar
0 votes
1 answer
596 views

How to change deprecated onPrepareOptionsMenu

I tried to change code for deprecated menu methods such as setHasOptionsMenu, onPrepareOptionsMenu... used in fragment. I found maybe similar task link, but I don't know how to change. Here is current ...
Musketyr's user avatar
  • 763
0 votes
0 answers
146 views

How can I resolve this Error inflating class CheckBox

Due to the fact that import kotlinx.android.synthetic.main is stuck when uploading the sdk to the project, I have been trying to do the migration but I can't get it to work. I have seen the ...
JK97Tae's user avatar
  • 28
0 votes
2 answers
128 views

Inflating a view outside of onCreateView in Fragment

Android docs teach us to inflate our xml layouts in onCreateView and than to return inflated view. But what about inflating in other places? I want to inflate my view in constructor, store in a filed, ...
stone-w4tch3r's user avatar
0 votes
1 answer
144 views

Cannot inflate android.widget.Toolbar after using PreferenceFragmentCompat [cause: RtlSpacingHelper]

A FragmentActivity that is correctly inflating android.widget.Toolbar stops doing so after the first deployment of androidx.preference.PreferenceFragmentCompat. The stacktrace indicates the underlying ...
Bad Loser's user avatar
  • 3,115
0 votes
1 answer
83 views

how to change layoutinflater to use another layout in kotlin to use fragments?

I'm improving an app by adding tabs (fragments), so now, my activity_main.xml is: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas....
Harmony Valley's user avatar
0 votes
1 answer
55 views

What is the LayoutInflater in Android? How does it differs from findViewById?

An example LayoutInflater code: View inflate = LayoutInflater.from(parent.getContext()).inflate(R.layout.,parent,false); Can't understand the work of LayoutInflater in Android. Tried to read the ...
Shubham Pawar's user avatar
0 votes
2 answers
212 views

Binding working fine in MainActivity.kt but not working properly on BirthdayGreetingActivity.kt (another activity file). Unresolved reference: inflate

I was learning kotlin with binding while MainActivity.kt is working completely fine, when I am trying to do the same steps in another Activity named BirthdayGreetingActivity.kt , inflate method is not ...
Archis03007's user avatar
0 votes
1 answer
276 views

View binding in activity have some issues with inflate and root

I have issues with view binding in android studio with inflate and root. below of inflate and root is a redline. I also write view binding modules in build.gradle. This is my build.gradle codes. ...
Mahdi Ahmadi's user avatar
2 votes
1 answer
126 views

Cannot hide ViewStub layout

I have layout for no internet connection in my app as ViewStub it should inflated and showing only when internet is disconnected "I have netwrok listener and var isNetworkAvailable as ...
Krista's user avatar
  • 64
0 votes
0 answers
28 views

AlertDialog with custom layout, but findViewById for the inflated layout keeps getting null

I've inflated my custom dialog into a variable called dialogView then using dialogView I tried to get the MaterialTextView, MaterialButton that is a child view to this, but it keep returning null to ...
Mike's user avatar
  • 1,247
1 vote
1 answer
72 views

Problems inflating a custom LinearLayout into a custom class that extends LinearLayout

I'm trying to inflate a LinearLayout containing a few different Textviews and a Button into a custom class that extends LinearLayout. Here is the XML: <?xml version="1.0" encoding="...
Bat BRT's user avatar
  • 57
0 votes
1 answer
89 views

Why do you pass LayoutInflater to inflate()?

Here's the code: private lateinit var binding: ResultProfileBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ResultProfileBinding.**...
ntos's user avatar
  • 287
1 vote
1 answer
413 views

NullPointerException: Attempt to invoke virtual method 'int android.view.ViewGroup.getPaddingBottom()' on a null object reference

Crashing when I am trying to inflate menu to BottomNavigationView but got crash on same. I have updated material design library from 'com.google.android.material:material:1.2.1' to 'com.google.android....
Sumit Jain's user avatar
  • 1,140
0 votes
2 answers
880 views

Menu items are not displayed in the Android app

everyone! I'm a beginner, developing a mobile app. Friends, my menu items are not displayed. I click on three dots clicking on the menu. A white window appears window without menu items. Program code &...
MAGistr's user avatar
  • 43

15 30 50 per page
1
2 3 4 5
44