android - java.lang.InstantiationException: class has no zero argument constructor -


i trying use broadcastreceiver inner class track network state got exception in title. should fix problem?

public class networkchangereceiver extends broadcastreceiver {     public networkchangereceiver() {     }      @override     public void onreceive(context context, intent intent) {         final connectivitymanager connmgr = (connectivitymanager) context                 .getsystemservice(context.connectivity_service);          final android.net.networkinfo wifi = connmgr.getnetworkinfo(connectivitymanager.type_wifi);          final android.net.networkinfo mobile = connmgr.getnetworkinfo(connectivitymanager.type_mobile);          if (wifi.isavailable() || mobile.isavailable()) {             setupdata();             log.d("netowk available ", "flag no 1");         }      } } 

your

inner broadcast receiver must static ( registered through manifest)

or

non-static broadcast receiver must registered , unregistered inside parent class

for this.

i using inner broadcast reciver, without registering within class. either make static , register in manifest , or make non static , register , unregister inside parent class .


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -