Questions tagged [butterknife]

An annotation-based Android view "injection" framework aimed at reducing boilerplate.

View "injection" library for Android which uses annotation processing to generate boilerplate code for you.

  • Eliminate findViewById calls by using @Bind on fields.
  • Group multiple views in a list using @BindViews. Operate on all of them at once with actions, setters, or properties.
  • Eliminate anonymous inner-classes for listeners by annotating methods with @OnClick and others.

The documentation includes additional code examples and use cases.

ButterKnife is open sourced under Apache 2.0 license.

536 questions
-1
votes
2 answers

Gradle - Runtime exception:(

I tried to add to my project butterknife.BindView and broke everything:(. I do not understand why I have runtime exception? I think maybe it's in androidX or lombok? Gradle: // Top-level build file where you can add configuration options common to…
-1
votes
2 answers

Android Butterknife null object reference error

I have an error in Android ButterKnife, using androidx instead of android java.lang.NullPointerException: Attempt to invoke virtual method 'void…
Ashik Azeez
  • 404
  • 5
  • 8
-1
votes
1 answer

Butterknife throws java.lang.IllegalStateException because a view (not existing now) is not found

I'm using Butterknife 8.8.1. Unfortunately android studio throws an IllegalStateException because a view with respective id (which I renamed through refactor menu) cannot be found! java.lang.RuntimeException: Unable to start activity…
Naveen
  • 31
  • 2
  • 7
-1
votes
1 answer

can butterknife bind OnTextChanged events to multiple controls like this?

我想对多个EditText设置监听事件,但看起来好像一次只能绑定一个资源,我知道OnClick方法可以绑定多个资源id,但EditText 好像不行,我不确定想问一下各位,英文不好请见谅 I'd like to set up listening events for multiple EditTexts, but it looks like I can only bind one resource at a time. I know the OnClick method can bind…
FM1024
  • 173
  • 1
  • 7
-1
votes
1 answer

EditText is null in Dialog instance

I have a dialog that pops up at first run and prompts the user to enter his/her username inside an editText view but whenever i try to access it's text by doing editText.getText(); i get a NullPointerException saying that the editText is null.What…
-1
votes
1 answer

Butterknife and TextViews

I have never used butterknife before. Instead of using the repeated findViewById(...) in my project, I want to use that library instead. However I get an exception. java.lang.NullPointerException: Attempt to invoke virtual method 'void…
Theo
  • 3,099
  • 12
  • 53
  • 94
-1
votes
2 answers

(Android Butterknife) how to change text on button after clicking

I have a button and I want to change text on it after it was clicked. @BindView(R.id.btn) Button btn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
jxn
  • 7
  • 3
-1
votes
2 answers

butter knife not compatible with appcompat:v7:24.2.1

HI am about to use butterknif in my project but it gave me an error enter image description here
-1
votes
1 answer

Unable to use butterknife in DroidWizard framework

I am using DroidWizard MVP framework for my android development and when I try to use butterknife library for dependency injection it is not working... public class FriendsFragment extends CoreFragment implements FriendsCallBack { private…
Prasanna Anbazhagan
  • 1,693
  • 1
  • 20
  • 37
-1
votes
2 answers

java.lang.NullPointerException: Attempt to invoke virtual method 'android.text.Editable android.widget.EditText.getText()' on a null object reference

I want put edittext from first activity to new secondactivity view text. What to do when I have an erro like this displayed in android monitor…
-1
votes
1 answer

Android Butterknife add Textview onClick

I have an activity where the user enters some ingredient info and an add button. How would I add a textview using butterknife? I am currently getting no errors and nothing onscreen so I must be trying to implement this wrong.
Vahalaru
  • 380
  • 4
  • 15
-1
votes
1 answer

butterknife edit text and "cannot resolve symbol" string

I'm having some issues with using Butterknife and getting text from EditTexts. I have an activity with many EditTexts. For brevity sake, I'll only include 2-3 in my code example(s). I'm eventually taking the entered text and using it with iText's…
langsmith
  • 2,529
  • 1
  • 11
  • 13
-1
votes
2 answers

onclicklistener for ImageView in butterknife is not working

This is my view binder code. Here the acceptbutton and reject button is not working. @Layout(R.layout.item) public class TinderCard implements AsyncTaskCompleteListener { SessionManager msession; private static final String LIKE = "1"; private…
Shan
  • 19
  • 5
-1
votes
1 answer

InflateException when creating Navigation Drawer

I created an android application using ButterKnife. I wanted to add an activity with Navigation bar . So I used , Navigation Drawer Activityin android studio. Then I tried to launch it using another activity .Like this , Intent intent = new…
-1
votes
1 answer

Cannot Bind view variables

When I try to bind, I get an error saying that cannot resolve method 'bind(name of my main activity)'. @BindView(R.id.timeLabel) TextView mTimeLabel; @BindView(R.id.temperatureLabel) TextView mTemperatureLabel; @BindView(R.id.humidityValue) TextView…
user2683183
  • 243
  • 2
  • 7
  • 23
1 2 3
35
36