Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a keyboard shortcut to findviewbyId in Android?

I don't like to write findViewById everytime is there a keyboard shortcut for it please I am a newbie to coding help me ?

like image 324
CodeNoob Avatar asked Aug 11 '16 16:08

CodeNoob


People also ask

How does findViewById work on android?

The findViewById() method is a method of Android's View and Activity classes. The method is used to find an existing view in your XML layout by its android:id attribute. The same can be done for any valid Android View object, such as a Button or a CheckBox view.

How do I redo in Android Studio?

It is simple and default: ( CTRL + Z ) This is for undo. Just press ( CTRL + SHIFT + Z ) for redo.


2 Answers

As a Matter of fact there is a keyboard shortcut to write findViewById

  • if you want to write findViewById you could write fb+enter in valid context
  • if you want to write findViewById(R.id.) you could write fbc+enter
like image 165
Mayank Wadhwa Avatar answered Oct 16 '22 07:10

Mayank Wadhwa


I don't know for shortcuts, but there is a library called ButterKnife which really simplifies some process like findViewById() or getRescources() and many others ;-)

http://jakewharton.github.io/butterknife/

like image 29
Omar Aflak Avatar answered Oct 16 '22 07:10

Omar Aflak