I am facing an error on android studio. I have been working on an assignment and for the past week, with everything going according to plan. Today I added some small code and the build executes, however, it force closes the app. I tried running a previous version (which I am SURE that worked) and it's giving me the same error in logcat. The error is:
2019-05-30 13:10:01.626 28770-28770/? E/Zygote: isWhitelistProcess -
Process is Whitelisted
2019-05-30 13:10:01.629 28770-28770/? E/Zygote: accessInfo : 1
2019-05-30 13:10:02.768 28770-28770/com.example.myapplication
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.myapplication, PID: 28770
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.myapplication/
com.example.myapplication.fingerprint}:
android.view.InflateException: Binary XML file line #70: Binary XML
file
line #70: Error inflating class Button
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3115)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3258)
at
android.app.servertransaction.LaunchActivityItem.execute
(LaunchActivityItem.ja va:78)
at
android.app.servertransaction.TransactionExecutor.
executeCallbacks(TransactionExecutor.java:108)
at
android.app.servertransaction.TransactionExecutor.
execute(TransactionExecutor.java:68)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7073)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller
.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Caused by: android.view.InflateException: Binary XML file line #70:
Binary XML file line #70: Error inflating class Button
Caused by: android.view.InflateException: Binary XML file line #70:
Error inflating class Button
Caused by: android.content.res.Resources$NotFoundException: Drawable
android:color/tertiary_text_light with resource ID #0x1060011
Caused by: android.content.res.Resources$NotFoundException: File
res/color/tertiary_text_light.xml from drawable resource ID #0x1060011
at android.content.res.ResourcesImpl.loadDrawableForCookie
(ResourcesImpl.java:898)
at
android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:677)
at android.content.res.Resources.loadDrawable(Resources.java:912)
at
android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:955)
at android.content.res.TypedArray.getDrawable(TypedArray.java:930)
at android.view.View.<init>(View.java:5442)
at android.widget.TextView.<init>(TextView.java:1118)
at android.widget.Button.<init>(Button.java:181)
at android.widget.Button.<init>(Button.java:156)
at android.support.v7.widget.AppCompatButton.<init>
(AppCompatButton.java:71)
at android.support.v7.widget.AppCompatButton.<init>
(AppCompatButton.java:67)
at android.support.v7.app.AppCompatViewInflater.createButton
(AppCompatViewInflater.java:187)
at android.support.v7.app.AppCompatViewInflater.createView
(AppCompatViewInflater.java:110)
at android.support.v7.app.AppCompatDelegateImpl.createView
(AppCompatDelegateImpl.java:1266)
at android.support.v7.app.AppCompatDelegateImpl.onCreateView
(AppCompatDelegateImpl.java:1316)
at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:811)
at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:769)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:902)
at
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:863)
at android.view.LayoutInflater.inflate(LayoutInflater.java:554)
at android.view.LayoutInflater.inflate(LayoutInflater.java:461)
at android.view.LayoutInflater.inflate(LayoutInflater.java:383)
at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at android.support.v7.app.AppCompatActivity.setContentView
(AppCompatActivity.java:140)
at com.example.myapplication.fingerprint.onCreate
(fingerprint.java:58)
at android.app.Activity.performCreate(Activity.java:7327)
at android.app.Activity.performCreate(Activity.java:7318)
at android.app.Instrumentation.callActivityOnCreate
(Instrumentation.java:1275)
at android.app.ActivityThread.performLaunchActivity
(ActivityThread.java:3095)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3258)
at android.app.servertransaction.LaunchActivityItem.execute
(LaunchActivityItem.java:78)
2019-05-30 13:10:02.773 28770-28770/com.example.myapplication
E/AndroidRuntime: at
android.app.servertransaction.TransactionExecutor.executeCallbacks
(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute
(TransactionExecutor.java:68)
at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7073)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file
line #18: <item> tag requires a 'drawable' attribute or child tag
defining a drawable
at
android.graphics.drawable.StateListDrawable.inflateChildElements
(StateListDrawable.java:190)
at
android.graphics.drawable.StateListDrawable.inflate
(StateListDrawable.java:122)
at
android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity
(DrawableInflater.java:146)
at android.graphics.drawable.Drawable.createFromXmlInnerForDensity
(Drawable.java:1359)
at android.graphics.drawable.Drawable.createFromXmlForDensity
(Drawable.java:1318)
at android.content.res.ResourcesImpl.loadDrawableForCooki
e(ResourcesImpl.java:879)
This is my layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/darker_gray"
tools:context=".MainActivity">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBarLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:theme="#style/AppTheme.AppBarOverlay"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="427dp"
android:layout_height="wrap_content"
android:background="#android:color/background_dark"
app:popupTheme="#style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<TextView
android:id="#+id/txt_name"
android:layout_width="169dp"
android:layout_height="22dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="76dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:text="Enter Name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.513"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/appBarLayout" />
<EditText
android:id="#+id/eT_name"
android:layout_width="212dp"
android:layout_height="37dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.601"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txt_name" />
<TextView
android:id="#+id/txt_surname"
android:layout_width="169dp"
android:layout_height="21dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="64dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:text="Enter Surname"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txt_name" />
<EditText
android:id="#+id/eT_surname"
android:layout_width="212dp"
android:layout_height="37dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.601"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txt_surname" />
<Button
android:id="#+id/btn_loadData"
android:layout_width="172dp"
android:layout_height="43dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="64dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:text="Load Data"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.506"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/eT_surname" />
<TextView
android:id="#+id/txt_savedData"
android:layout_width="219dp"
android:layout_height="102dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="132dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</android.support.constraint.ConstraintLayout>
The problem was that I set the color to a button. Upon changing the color, it worked. I don't know what made it not work though..
Related
I am very new to Android development and I am having an issue with an onClick function in my app. I have five buttons on one activity, and all of them are using the exact same code:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Book 2"
android:layout_weight="1"
android:onClick="openBook2"/>
They're obviously adjusted according to the different java functions, which all look like this:
public void openBook2(View view) {
Intent i = new Intent(this, Real2.class);
startActivity(i);
}
The other four functions work perfectly, without error. For some reason, only this function causes a crash. Like I said, I'm new to this so I don't really understand what is going wrong here (or how to properly debug). I ran breakpoints on the openBook2 function and it came back with this in AppCompatViewInflater.java:
#Override
public void onClick(#NonNull View v) {
if (mResolvedMethod == null) {
resolveMethod(mHostView.getContext(), mMethodName);
}
try {
mResolvedMethod.invoke(mResolvedContext, v);
} catch (IllegalAccessException e) {
throw new IllegalStateException(
"Could not execute non-public method for android:onClick", e);
} catch (InvocationTargetException e) {
throw new IllegalStateException(
"Could not execute method for android:onClick", e);
}
}
I don't know what this means. I also know that I should be using a click listener because having the onClick directly in the xml is bad but I have tried to understand click listeners and I truly do not. And, the onClick has been working perfectly fine for me about a hundred other times in the app so I don't see a problem with it (especially since my app is only buttons and TextViews).
If you need any additional information, please let me know!
Logcat error:
2020-04-24 23:37:07.198 19688-19688/co.hyperstudios.elderscrollslibrary E/AndroidRuntime: FATAL EXCEPTION: main
Process: co.hyperstudios.elderscrollslibrary, PID: 19688
java.lang.RuntimeException: Unable to start activity ComponentInfo{co.hyperstudios.elderscrollslibrary/co.hyperstudios.elderscrollslibrary.Real2}: android.view.InflateException: Binary XML file line #75 in co.hyperstudios.elderscrollslibrary:layout/activity_real2: Binary XML file line #75 in co.hyperstudios.elderscrollslibrary:layout/activity_real2: Error inflating class TextView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
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:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: android.view.InflateException: Binary XML file line #75 in co.hyperstudios.elderscrollslibrary:layout/activity_real2: Binary XML file line #75 in co.hyperstudios.elderscrollslibrary:layout/activity_real2: Error inflating class TextView
Caused by: android.view.InflateException: Binary XML file line #75 in co.hyperstudios.elderscrollslibrary:layout/activity_real2: Error inflating class TextView
Caused by: java.lang.IndexOutOfBoundsException: setSpan (5851 ... 5857) ends beyond length 16
at android.text.SpannableStringInternal.checkRange(SpannableStringInternal.java:490)
at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:196)
at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:183)
at android.text.SpannableString.setSpan(SpannableString.java:60)
at android.content.res.StringBlock.applyStyles(StringBlock.java:217)
at android.content.res.StringBlock.get(StringBlock.java:161)
at android.content.res.ApkAssets.getStringFromPool(ApkAssets.java:140)
at android.content.res.AssetManager.getPooledStringForCookie(AssetManager.java:787)
at android.content.res.TypedArray.loadStringValueAt(TypedArray.java:1375)
at android.content.res.TypedArray.getText(TypedArray.java:233)
at android.widget.TextView.<init>(TextView.java:1214)
at android.widget.TextView.<init>(TextView.java:968)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:99)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:95)
at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:182)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1407)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1457)
at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1061)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:997)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
2020-04-24 23:37:07.198 19688-19688/co.hyperstudios.elderscrollslibrary E/AndroidRuntime: at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at co.hyperstudios.elderscrollslibrary.Real2.onCreate(Real2.java:14)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
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:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
activity_real2 TextView:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Real2"
android:orientation="vertical">
<!--Title and author-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:layout_marginTop="16dp"
android:textColor="#android:color/black"
android:text="The Real Barenziah"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Plitinius Mero" />
<!--Buttons for different parts of the book-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="8dp"
android:paddingTop="8dp" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Book 1"
android:layout_weight="1"
android:onClick="openBook1"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Book 2"
android:layout_weight="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Book 3"
android:layout_weight="1"
android:onClick="openBook3"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Book 4"
android:layout_weight="1"
android:onClick="openBook4"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Book 5"
android:layout_weight="1"
android:onClick="openBook5"/>
</LinearLayout>
<!--Book text-->
<ScrollView
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/real2"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:paddingRight="16dp"
android:layout_gravity=""
android:textSize="15sp" />
</ScrollView>
</LinearLayout>
Yes, your problem is exactly the ScrollView. ScrollView doesn't work like that it has to have a layout on it to be used. so just add simply a layout on your ScrollView and put your TextView on that layout.
ScrollView > LinearLayout > TextView
(You can change LinearLayout to any ViewGroup type)just like this:
<ScrollView
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation:"vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/real2"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:paddingRight="16dp"
android:layout_gravity=""
android:textSize="15sp" />
</LinearLayout>
</ScrollView>
Edit:
The Second problem and main problem of your code is probably the long String you had set for TextView just try to reduce the text.
My app fails to start because of Error inflating class ImageButton, Because of this the phone says "app has stopped" Etc.
I am using firebase test lab to debug the problem
the Errors occur on samsung devices specifically A20, s7 Edge , s7(tested with firebase same problem)
I am new to android and have tried many solutions from google and SO none have worked sofar
Here is the error report on firebase
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.smartpractice.smartpracticesmartapp/com.smartpractice.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #117: Binary XML file line #117: Error inflating class ImageButton
FATAL EXCEPTION: main
Process: com.smartpractice.smartpracticesmartapp, PID: 26921
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.smartpractice.smartpracticesmartapp/com.smartpractice.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #117: Binary XML file line #117: Error inflating class ImageButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
at android.app.ActivityThread.access$1100(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: android.view.InflateException: Binary XML file line #117: Binary XML file line #117: Error inflating class ImageButton
at android.view.LayoutInflater.inflate(LayoutInflater.java:551)
at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.smartpractice.myapplication.MainActivity.onCreate(MainActivity.java:14)
at android.app.Activity.performCreate(Activity.java:6876)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)
... 9 more
Caused by: android.view.InflateException: Binary XML file line #117: Error inflating class ImageButton
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:847)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:855)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810)
at android.view.LayoutInflater.inflate(LayoutInflater.java:527)
... 17 more
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f070089
at android.content.res.Resources.getValue(Resources.java:2558)
at androidx.appcompat.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:331)
at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:198)
at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:191)
at androidx.appcompat.content.res.AppCompatResources.getDrawable(AppCompatResources.java:102)
at androidx.appcompat.widget.AppCompatImageHelper.loadFromAttributes(AppCompatImageHelper.java:59)
at androidx.appcompat.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:79)
at androidx.appcompat.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:69)
at androidx.appcompat.app.AppCompatViewInflater.createImageButton(AppCompatViewInflater.java:202)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:122)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1266)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1316)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:758)
Here is the XML
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/relativeLayout4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/ic_launcher_background"
tools:context=".MainActivity">
<com.google.android.flexbox.FlexboxLayout
android:id="#+id/flexboxLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:alignContent="stretch"
app:alignItems="stretch"
app:flexWrap="wrap"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.863"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/guideline7">
<TextView
android:id="#+id/textView"
android:layout_width="match_parent"
android:layout_height="48dp"
android:fontFamily="#font/nunito"
android:gravity="center_horizontal"
android:text="#string/welcome_to_smartpractice"
android:textSize="24sp"
app:fontFamily="#font/nunito"
app:layout_alignSelf="baseline"
tools:layout_editor_absoluteY="100dp"
tools:targetApi="jelly_bean" />
<TextView
android:id="#+id/textView7"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimaryDark"
android:gravity="center_horizontal|fill_vertical"
android:text="#string/docsharesmart"
android:textColor="#color/ic_launcher_background"
app:layout_alignSelf="flex_end"
tools:layout_editor_absoluteY="16dp" />
</com.google.android.flexbox.FlexboxLayout>
<com.google.android.flexbox.FlexboxLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:alignContent="center"
app:alignItems="stretch"
app:flexDirection="row"
app:flexWrap="nowrap"
app:justifyContent="space_between"
app:layout_constraintBottom_toTopOf="#+id/guideline7"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="#+id/imageView3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="#string/logo1"
app:layout_alignSelf="center"
app:srcCompat="#drawable/smartpractice_logo_02"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="-46dp" />
<ImageButton
android:id="#+id/LoginScreen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#null"
android:contentDescription="#string/loginscreen"
app:layout_alignSelf="center"
app:layout_wrapBefore="false"
app:srcCompat="#drawable/ic_more_vert_black_24dp"
tools:layout_editor_absoluteX="248dp"
tools:layout_editor_absoluteY="134dp" />
</com.google.android.flexbox.FlexboxLayout>
<com.google.android.flexbox.FlexboxLayout
android:id="#+id/flexboxLayout2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:alignContent="stretch"
app:alignItems="stretch"
app:flexWrap="wrap"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/flexboxLayout"
app:layout_constraintVertical_bias="0.146">
Here is line 117 from the error
<ImageButton
android:id="#+id/UploadButton"
android:layout_width="300dp"
android:layout_height="209dp"
android:background="#android:color/transparent"
app:layout_constraintTop_toBottomOf="#+id/flexboxLayout"
app:srcCompat="#drawable/upload_files_upload"
android:contentDescription="#string/todo" />
</com.google.android.flexbox.FlexboxLayout>
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideline7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_begin="185dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
It means upload_files_upload is not found in drawble folder, well this can be a case, where your file may present in drawable-24 but not in drawble folder, in that case this problem still arise. The point is your file must be in all drawble folder.
The reason for your error is that the upload_files_upload is not in your drawable folder :
<ImageButton
android:id="#+id/UploadButton"
android:layout_width="300dp"
android:layout_height="209dp"
android:background="#android:color/transparent"
app:layout_constraintTop_toBottomOf="#+id/flexboxLayout"
app:srcCompat="#drawable/upload_files_upload"// this line
android:contentDescription="#string/todo" />
I have solved The Issue I changed app:srcCompat="#drawable/upload_files_upload"// to android:src="#drawable/upload_files_upload"
So the problem was by app:srcCompat I changed it to Android:src and it works fine now
I am getting following error for the line #30 i.e. first line of first EditText in the provided code. This XML is basically associated with an Activity. The error is while binding XML inside activity
setContentView(R.layout.activity_login)
The error is as follows:
Caused by android.view.InflateException: Binary XML file line #30: Binary XML file line #30: Error inflating class EditText
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.pockethcm.greytrix.test.LoginActivity.onCreate(LoginActivity.kt:39)
at android.app.Activity.performCreate(Activity.java:6268)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2370)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2477)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1345)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5468)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:781)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:671)
I have tried couple of things explained in other answers but none of them actually helped me. I am not using any drawable resource for that EditText.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="#drawable/login_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.pockethcm.greytrix.test.LoginActivity"
>
<LinearLayout
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:paddingStart="#dimen/_20sdp"
android:paddingEnd="#dimen/_20sdp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/login_layout">
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/profile_image"
android:layout_width="match_parent"
android:layout_height="96dp"
android:src="#drawable/pocketlogosplash"
app:civ_border_width="2dp"
app:civ_circle_background_color="#color/colorWhite"
app:civ_border_color="#bcbcbc"/>
<EditText
android:layout_width="match_parent"
android:backgroundTint="#color/colorWhite"
android:layout_height="wrap_content"
android:hint="Company Code"
android:textColorHint="#color/colorWhite"
android:layout_marginTop="20dp"
android:drawableStart="#drawable/ic_store_white_24dp"
android:drawablePadding="10dp"
android:textColor="#color/colorWhite"
android:id="#+id/company_code"
android:imeOptions="actionNext"
android:maxLines="1"
android:singleLine="true"/>
<EditText
android:layout_width="match_parent"
android:backgroundTint="#color/colorWhite"
android:layout_height="wrap_content"
android:hint="Employee Code"
android:textColorHint="#color/colorWhite"
android:layout_marginTop="20dp"
android:drawableStart="#drawable/ic_person_black_24dp"
android:drawablePadding="10dp"
android:textColor="#color/colorWhite"
android:id="#+id/employee_code"
android:drawableTint="#color/colorWhite"
android:imeOptions="actionNext"
android:maxLines="1"
android:singleLine="true"/>
</LinearLayout>
</ScrollView>
EditText widget should load normally but the activity is crashing with error above.
Providing additional info:
compileSdkVersion 28
minSdkVersion 21
targetSdkVersion 28
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.31"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
You should set left drawable programmatically if its vector for pre kitkat.
company_code.setCompoundDrawablesWithIntrinsicBounds(AppCompatResources.getDrawable(this,R.drawable.ic_store_white_24dp), null, null, null);```
Which android version you are using, I think you use Vector Drawable in EditText, But Vector Drawable support after KitKat.
I am trying to create a page in android app. It is working fine in all the mobiles except in the mobile which is having Android 8.0. Here is the XML file code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/bg3_logo"
>
<TextView
android:id="#+id/text1d"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:enabled="true"
android:maxLength="50"
android:text="Welcome Customer xxxxxx"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="#+id/text2d"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="true"
android:maxLength="50"
android:text="" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignTop="#+id/imageButton1"
android:gravity="center"
android:singleLine="false"
android:text=""
android:textSize="12dp" />
<TextView
android:id="#+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/text2"
android:enabled="true"
android:maxLength="50"
android:text=""
android:textSize="12dp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageButton
android:id="#+id/imageButton12"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_below="#+id/textView3"
android:layout_marginRight="14dp"
android:background="#drawable/rotate6"
android:contentDescription="From Date" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="-10dp"
android:layout_gravity="right">
<ImageButton
android:id="#+id/imageButtondl"
android:layout_width="50dip"
android:layout_height="50dip"
android:background="#drawable/logout"
android:contentDescription="Logout" />
</LinearLayout>
<ListView
android:id="#+id/mylist"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
/>
<Button
android:id="#+id/btn_static"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="EDIT"/>
</LinearLayout>
I was not able to get the log cat as my emulator was not in a working mode due to restriction of proxy server in our domain. Please help me out guys
Finally able to get the Stack trace by sending it to mail
java.lang.RuntimeException: Unable to start activity ComponentInfo{kvbank.kvb_ebook/kvbank.kvb_epassbook.dummy}: android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
at android.app.ActivityThread.startActivityNow(ActivityThread.java:2744)
at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:136)
at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:348)
at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:769)
at android.widget.TabHost.setCurrentTab(TabHost.java:423)
at android.widget.TabHost.addTab(TabHost.java:233)
at kvbank.kvb_epassbook.TabDemo.onCreate(TabDemo.java:87)
at android.app.Activity.performCreate(Activity.java:6998)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1230)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2899)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3046)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1688)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6809)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class <unknown>
Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class <unknown>
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:720)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:432)
at android.app.Activity.setContentView(Activity.java:2677)
at kvbank.kvb_epassbook.dummy.onCreate(dummy.java:190)
at android.app.Activity.performCreate(Activity.java:6998)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1230)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2899)
at android.app.ActivityThread.startActivityNow(ActivityThread.java:2744)
at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:136)
at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:348)
at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:769)
at android.widget.TabHost.setCurrentTab(TabHost.java:423)
at android.widget.TabHost.addTab(TabHost.java:233)
at kvbank.kvb_epassbook.TabDemo.onCreate(TabDemo.java:87)
at android.app.Activity.performCreate(Activity.java:6998)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1230)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2899)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3046)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1688)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6809)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x101009b a=1}
at android.content.res.TypedArray.getColorStateList(TypedArray.java:538)
at android.widget.TextView.<init>(TextView.java:910)
at android.widget.TextView.<init>(TextView.java:824)
at android.widget.TextView.<init>(TextView.java:820)
... 37 more
SOLUTION
Issue got solved. I am using "android:theme="#android:style/Theme.Holo""
for my dummy class in android manifest which is not defined. removing
this line solved my issue
As you said, you are not able to get Log file. I'm not pretty much sure on the reason behind this. You may try this.
1. Unexpected text /> in your xml below the Listview myList. Remove that part
Even you can see warning in your XML with Unexpected text found in file: "/>" Always Check your XML warning for any InflateClassException
Layout Resource file should only content elements and attributes.Any
XML text content found in file is likely accidental.
(From the warning message that represents the chance of crash.)
2. Remove Numbers form Id as ids are typically assigned in the layout XML file as a string.
So I think I'm having some scoping issues.
I'm trying to use the function setZipEdit to set the R.id.zipHolder editText in my activity. I'm just having issues in setting up the code to be able to do this. Below is what I have which isn't currently working. mZipHold is coming back as not initialized which I though it was in the override
UPDATED
class SecondActivity : AppCompatActivity() {
lateinit var townInfo:JsonArray<JsonObject>
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity2)
SET_TOWN.setOnClickListener {v -> setTowns()}
GET_TOWNS.setOnClickListener {v -> retrieveTowns()}
}
fun setZipEdit(zipEdit:String){
Log.d("SZE",zipEdit)
zipHolder.setText(zipEdit)
//mZipHold.setText(zipEdit,TextView.BufferType.EDITABLE)
}
java.lang.NullPointerException: Attempt to invoke virtual method
'android.view.Window$Callback android.view.Window.getCallback()' on a
null object reference
at
android.support.v7.app.AppCompatDelegateImplBase.(AppCompatDelegateImplBase.java:117)
at
android.support.v7.app.AppCompatDelegateImplV9.(AppCompatDelegateImplV9.java:149)
at
android.support.v7.app.AppCompatDelegateImplV11.(AppCompatDelegateImplV11.java:29)
at
android.support.v7.app.AppCompatDelegateImplV14.(AppCompatDelegateImplV14.java:54)
at
android.support.v7.app.AppCompatDelegateImplV23.(AppCompatDelegateImplV23.java:31)
at
android.support.v7.app.AppCompatDelegateImplN.(AppCompatDelegateImplN.java:31)
at
android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:198)
at
android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:183)
at
android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:519)
at
android.support.v7.app.AppCompatActivity.findViewById(AppCompatActivity.java:190)
at
com.example.sdfsdf.listview.SecondActivity._$_findCachedViewById(SecondActivity.kt:0)
at
com.example.sdfsdf.listview.SecondActivity.setZipEdit(SecondActivity.kt:44)
at
com.example.sdfsdf.listview.SecondActivity$MyCustomAdapter$onCreateViewHolder$1.onClick(SecondActivity.kt:124)
at android.view.View.performClick(View.java:6256)
at android.view.View$PerformClick.run(View.java:24697)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
XML
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="25dp">
<ImageView
android:id="#+id/returnimage"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginStart="8dp"
android:layout_marginTop="20dp"
android:contentDescription="logoforZip"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_new_icon_plain" />
<EditText
android:id="#+id/zipHolder"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginStart="8dp"
android:layout_marginTop="20dp"
android:ems="10"
android:inputType="number"
android:text="ZIP HERE"
android:textAlignment="center"
android:textColor="#000000"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/returnimage"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/SET_TOWN"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="8dp"
android:text="SET TOWN"
app:layout_constraintEnd_toEndOf="#+id/zipHolder"
app:layout_constraintStart_toStartOf="#+id/zipHolder"
app:layout_constraintTop_toBottomOf="#+id/zipHolder" />
<Button
android:id="#+id/GET_TOWNS"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="8dp"
android:text="LIST NEARBY TOWNS"
app:layout_constraintEnd_toEndOf="#+id/SET_TOWN"
app:layout_constraintStart_toStartOf="#+id/SET_TOWN"
app:layout_constraintTop_toBottomOf="#+id/SET_TOWN" />
<View
android:id="#+id/splitbar"
android:layout_width="fill_parent"
android:layout_height="6dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:background="#c0c0c0"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/GET_TOWNS" />
<android.support.v7.widget.RecyclerView
android:id="#+id/zipList"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="#222222"
android:scrollbars="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/splitbar" />
</android.support.constraint.ConstraintLayout>
Ok, But using kotlinextension is a better way to do this, I think you need to do 2 things may solve your problem
first
import kotlinx.android.synthetic.main.activity_main2.*
I think which you have already done
second instead of initializing your Editext by findViewById direct use as
fun setZipEdit(zipEdit:String){
Log.d("SZE",zipEdit)
Log.d("mzh",mZipHold.toString())
zipHolder.setText(zipEdit)
//mZipHold.setText(zipEdit,TextView.BufferType.EDITABLE)
}
you can access your views by only use their id. Let try this and let me know if works