This is my first android app. I had a main activity defined in the androidmainifest.xml with the intent-filter block. I then had a number of subsequent activities. There are 5 altogether and 2 of them retrieve small bits of data from different web pages.
I then added a new activity that I wanted to be the main activity of the app. I cut the intent-filter block out of the initial main activity and pasted it in to the new activity that I wanted to be the main activity. It worked, in that this new activity was now the start up activity, but this new activity can't access web pages like all other activities.
I have uses-permission android:name="android.permission.INTERNET" above the application block in the androidmainfest.xml file Below is the stack trace.
android.os.NetworkOnMainThreadException
android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1236)
java.net.InetAddress.lookupHostByName(InetAddress.java:388)
java.net.InetAddress.getAllByNameImpl(InetAddress.java:239)
java.net.InetAddress.getAllByName(InetAddress.java:214)
com.android.okhttp.internal.Dns$1.getAllByName(Dns.java:28)
com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:216)
com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:122)
com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:292)
com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:179)
com.windsweptsoftware.wslistit.Utilities.GetNewData(Utilities.java:45)
com.windsweptsoftware.wslistit.LogIn.onLoginClicked(LogIn.java:96)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:515)
android.view.View$1.onClick(View.java:3860)
android.view.View.performClick(View.java:4480)
android.view.View$PerformClick.run(View.java:18673)
android.os.Handler.handleCallback(Handler.java:733)
android.os.Handler.dispatchMessage(Handler.java:95)
android.os.Looper.loop(Looper.java:157)
android.app.ActivityThread.main(ActivityThread.java:5872)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:515)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1069)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:885)
dalvik.system.NativeStart.main(Native Method)