A more advanced way would be to use butterknife bindview. This eliminates redundant code.
In your gradle under dependencies; add this 2 lines.
compile('com.jakewharton:butterknife:8.5.1') {
exclude module: 'support-compat'
}
apt 'com.jakewharton:butterknife-compiler:8.5.1'
Then sync up.
Example binding edittext in MainActivity
import butterknife.BindView;
import butterknife.ButterKnife;
public class MainActivity {
@BindView(R.id.name) EditTextView mName;
...
public void onCreate(Bundle savedInstanceState){
ButterKnife.bind(this);
...
}
}
But this is an alternative once you feel more comfortable or starting to work with lots of data.
toString
does not yield the most discoverable API, however fancy is the technique. – IllgottenEditable
object where users expect and need a simpleString
99% of times. – Saturnalia