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
1 answer

android butterknife with event listeners for repeating ids

My layout have repeating views ,ie a row having 5 buttons , currently I created separate xml and inserted in different parts of the view nut now am confused because I have no idea how I can implement click listeners for each button because…
Bytecode
  • 6,551
  • 16
  • 54
  • 101
-1
votes
1 answer

Null pointer exception is occuring while initializing the Textview using Butterknife

I have the following code: public static class PlaceholderFragment extends Fragment { private static final String ARG_SECTION_NUMBER = "section_number"; @InjectView(R.id.testTv) TextView textView; public static…
-2
votes
2 answers

How i can add ButterKnife Locally (No remote dependencies)

I have downloaded 'butterknife-8.8.1.aar' , 'butterknife-annotations-8.8.1.jar' and 'butterknife-compiler-8.8.1.jar' and added to the project. When i launch the app, i get NullPointer Exception for the view. public class MainActivity extends…
-2
votes
2 answers

How to use Butterknife with onClickListener in Activity?

I'm looking the answer how to make onClickListener button located in Recycleview Item using Butterknife. I know how to do it without Butterknife, but I can't find anything with Bt. Does Bt supports this?
user9897182
  • 255
  • 5
  • 18
-2
votes
1 answer

Using Butterknife for onClick

I have been looking online and I have seen so many different examples of how to use butterknife for implementing onClick . I would just like someone to show my the simplest way of doing it from a beginners perspective.
-2
votes
1 answer

Application close immediatly after start-up

My application close just after it is build with success and loaded into my device Actually it is the fullstack trace : /? I/art: Late-enabling -Xcheck:jni W/System: ClassLoader referenced unknown path:…
An-droid
  • 6,433
  • 9
  • 48
  • 93
-2
votes
1 answer

Error:android.content.res.Resources$NotFoundException: String resource ID #0x1

Am getting an error saying resource id can't be found tried tracing the problem the code seems fine This area contains my class that uses the xml resource below to show all the necessary elements anyone who can help to tell me why am getting such…
-2
votes
3 answers

OnClick linstener using Butterknife not working

OnClick linstener using Butterknife is not working when i click button it's not happening any thing,someone please check the code below and suggest me any modifications if any. MainActivity.java package com.example.niranjan.sample; import…
Niranjan
  • 1
  • 4
-2
votes
2 answers

butterknife prompt onclick method never unused

here is my code: public class MainActivity extends Activity { @OnClick(R.id.btn_login) void loginClick(){ // } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
Freddy
  • 764
  • 2
  • 6
  • 21
-3
votes
1 answer

Why won't it find these TextViews with ButterKnife in Android Studio?

Did I do something wrong with my code? For some reason I cannot get my text views from my activity_main.xml to link with my MainActivity.java file. Here is my code package com.dredaydesigns.radiostationfinder; import android.R; import…
dreday
  • 95
  • 1
  • 9
-4
votes
2 answers

butterknife8.3.0 and dagger2 are used together complains,but butterknife7.* is ok

javascript Error:E:\Android\myGit\GJBaseFrame\GJBaseFrame\app\src\main\java\com\yubaokang\baseframe\views\activitys\MainActivity.java:9: error: could not find the symbol Com.yubaokang.baseframe.dagger.component.DaggerMainActivityComponent…
1 2 3
35
36