Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: IntelliJ IDEA 12.1 Parameter view never used

Tags:

Explain me please, why IntelliJ IDEA shows me Parameter never used?

enter image description here

 public void onClick(View view) { // Parameter 'view' never used     Toast.makeText(this, "Hello", Toast.LENGTH_LONG).show(); }  <ToggleButton     ...     android:onClick="onClick"/> 

But I know, if I delete this never used parameter (view), Android will throw me Runtime Exception.

Why IntelliJ IDEA v12.1 shows such warnings but Eclipse doesn't show. How to configure IntelliJ IDEA to hide such warnings for all Android projects?

like image 447
Tom Yang Avatar asked Apr 10 '13 13:04

Tom Yang


1 Answers

For Kotlin, use this sentence to supress this warning :

fun onClick(@Suppress("UNUSED_PARAMETER")view: View) {  } 
like image 153
Kevin ABRIOUX Avatar answered Sep 22 '22 03:09

Kevin ABRIOUX