This is common in android to get error on http or networking connection with this message "android.os.NetworkOnMainThreadException" .
This exception is thrown when an application attempts to perform a networking operation on its main thread .
Run your code in AsyncTask that will solve your problem:
Hints:
Thread msgThread = new Thread(){
public void run(){
http.httpConnectionMsg(nvp,is,msgurl);
}
}
msgThread.start();
Thread msgThread = new Thread(){
ReplyDeletepublic void run(){
http.httpConnectionMsg(nvp,is,msgurl);
}
};
msgThread.start();