I have an app that chcecks (at start) if there is and internet connection. If yes it does some HTML parsing. If not I want it to register a broadcast receiver which will do HTML parsing just after internet connection comes up. I have created broadcast listener with this constructor:
public connectionListener(ConnectivityManager conMgr, htmlParserListener vystrahyListener, htmlParserListener podmienkyListener){
this.conMgr = conMgr;
this.vystrahyListener = vystrahyListener;
this.podmienkyListener = podmienkyListener;
}
However I cant instantiate it from android-manifest.xml because it says that it needs default constructor. When I added default (empty) constructor I ended up with null pointer exception because params were not passed.
This is the way I am creating connection listener:
connectionListener conLst = new connectionListener(conMgr, vystrahyListener, podmienkyListener);
is this a good approach or should I register it somehow differently (programatically)?
Thanks in forward
0 comments:
Post a Comment