I am facing an issue with AsynsTask in my Application. I really do not understand the reason of it happening.
The issue is "The application works perfectly usually, now when any of the activity is displayed on the screen and I keep my device idle for a longer period of time. Then when I make the keyguard on the view of the last active activity is displayed to me. But as soon as I click on any component below mentioned exception is thrown. If the device is not kept for a longer period of time then there is no problem as such. The application makes http connection in onResume of most of the activities. I did this since every time the user comes to particular view then he should get the updates lists of posts from the webservice"
W/AsyncTask(18829): java.lang.InterruptedException
W/AsyncTask(18829): at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1254)
W/AsyncTask(18829): at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:219)
W/AsyncTask(18829): at java.util.concurrent.FutureTask.get(FutureTask.java:82)
W/AsyncTask(18829): at android.os.AsyncTask$3.done(AsyncTask.java:196)
W/AsyncTask(18829): at java.util.concurrent.FutureTask$Sync.innerCancel(FutureTask.java:293)
W/AsyncTask(18829): at java.util.concurrent.FutureTask.cancel(FutureTask.java:75)
W/AsyncTask(18829): at android.os.AsyncTask.cancel(AsyncTask.java:325)
W/AsyncTask(18829): at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:73)
W/AsyncTask(18829): at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:1)
W/AsyncTask(18829): at android.os.AsyncTask$2.call(AsyncTask.java:185)
W/AsyncTask(18829): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
W/AsyncTask(18829): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
W/AsyncTask(18829): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
W/AsyncTask(18829): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
W/AsyncTask(18829): at java.lang.Thread.run(Thread.java:1096)
W/InputManagerService( 85): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#44daac80
D/NetworkStateTracker( 85): setDetailed state, old =CONNECTED and new state=DISCONNECTED
D/NetworkStateTracker( 85): setDetailed state, old =CONNECTED and new state=OBTAINING_IPADDR
D/WifiStateTracker( 85): DhcpHandler: DHCP request started
D/ConnectivityService( 85): ConnectivityChange for WIFI: CONNECTING/OBTAINING_IPADDR
D/ConnectivityService( 85): Dropping ConnectivityChange for WIFI: CONNECTING/OBTAINING_IPADDR
I/AudioHardwareQSD( 59): AudioHardware pcm playback is going to standby.
I/System.out(18829): URL for Subsection Bookmark reply ==> http://www.softwebdemo.com/viral/babbleville/services/getvilledetails.php?action=getbookmarksubsection&Userid=51&start=0&end=30
W/dalvikvm(18829): threadid=10: thread exiting with uncaught exception (group=0x4001d7f0)
E/AndroidRuntime(18829): FATAL EXCEPTION: AsyncTask #3
E/AndroidRuntime(18829): java.lang.RuntimeException: An error occured while executing doInBackground()
E/AndroidRuntime(18829): at android.os.AsyncTask$3.done(AsyncTask.java:200)
E/AndroidRuntime(18829): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
E/AndroidRuntime(18829): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
E/AndroidRuntime(18829): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
E/AndroidRuntime(18829): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
E/AndroidRuntime(18829): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
E/AndroidRuntime(18829): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
E/AndroidRuntime(18829): at java.lang.Thread.run(Thread.java:1096)
E/AndroidRuntime(18829): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
E/AndroidRuntime(18829): at android.os.Handler.<init>(Handler.java:121)
E/AndroidRuntime(18829): at android.app.Dialog.<init>(Dialog.java:101)
E/AndroidRuntime(18829): at android.app.AlertDialog.<init>(AlertDialog.java:63)
E/AndroidRuntime(18829): at android.app.AlertDialog.<init>(AlertDialog.java:59)
E/AndroidRuntime(18829): at android.app.AlertDialog$Builder.create(AlertDialog.java:786)
E/AndroidRuntime(18829): at com.babbleville.utils.BabbleVilleSyncTask.AlertOnInternetConnetion(BabbleVilleSyncTask.java:188)
E/AndroidRuntime(18829): at com.babbleville.utils.BabbleVilleSyncTask.checkInternetConnetion(BabbleVilleSyncTask.java:169)
E/AndroidRuntime(18829): at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:57)
E/AndroidRuntime(18829): at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:1)
E/AndroidRuntime(18829): at android.os.AsyncTask$2.call(AsyncTask.java:185)
E/AndroidRuntime(18829): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
E/AndroidRuntime(18829): ... 4 more
W/ActivityManager( 85): Force finishing activity com.babbleville/.VilleBookmarkReply
E/WindowManager(18829): Activity com.babbleville.VilleBookmarkReply has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#44a25940 that was originally added here
E/WindowManager(18829): android.view.WindowLeaked: Activity com.babbleville.VilleBookmarkReply has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#44a25940 that was originally added here
E/WindowManager(18829): at android.view.ViewRoot.<init>(ViewRoot.java:247)
E/WindowManager(18829): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
E/WindowManager(18829): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
E/WindowManager(18829): at android.view.Window$LocalWindowManager.addView(Window.java:424)
E/WindowManager(18829): at android.app.Dialog.show(Dialog.java:241)
E/WindowManager(18829): at com.babbleville.utils.BabbleVilleSyncTask.onPreExecute(BabbleVilleSyncTask.java:48)
E/WindowManager(18829): at android.os.AsyncTask.execute(AsyncTask.java:391)
E/WindowManager(18829): at com.babbleville.VilleBookmarkReply.loadSubsectionBookmark(VilleBookmarkReply.java:1186)
E/WindowManager(18829): at com.babbleville.VilleBookmarkReply.loadBookmarkSubsection(VilleBookmarkReply.java:1171)
E/WindowManager(18829): at com.babbleville.VilleBookmarkReply.onClick(VilleBookmarkReply.java:277)
E/WindowManager(18829): at android.view.View.performClick(View.java:2408)
E/WindowManager(18829): at android.view.View$PerformClick.run(View.java:8816)
E/WindowManager(18829): at android.os.Handler.handleCallback(Handler.java:587)
E/WindowManager(18829): at android.os.Handler.dispatchMessage(Handler.java:92)
E/WindowManager(18829): at android.os.Looper.loop(Looper.java:123)
E/WindowManager(18829): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/WindowManager(18829): at java.lang.reflect.Method.invokeNative(Native Method)
E/WindowManager(18829): at java.lang.reflect.Method.invoke(Method.java:521)
E/WindowManager(18829): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/WindowManager(18829): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/WindowManager(18829): at dalvik.system.NativeStart.main(Native Method)
D/NetworkStateTracker( 85): setDetailed state, old =OBTAINING_IPADDR and new state=CONNECTED
D/ConnectivityService( 85): ConnectivityChange for WIFI: CONNECTED/CONNECTED
D/WifiWatchdogService( 85): (android.server.ServerThread) Softwebsolutions (00:25:9c:0c:2d:c0) does not require the watchdog
D/ConnectivityService( 85): adding dns 192.168.3.105 for WIFI
D/Tethering( 85): Tethering got CONNECTIVITY_ACTION
D/Tethering( 85): MasterInitialState.processMessage what=3
E/HierarchicalStateMachine( 85): TetherMaster - unhandledMessage: msg.what=3
I/GTalkService( 214): [ServiceAutoStarter] --- connectivity changed
Can someone let me know the reason behind this error and any solution to this?
Related
installed XAMPP server, created database and successfully accessed it from chrome browser as well as from android emulator. However whenever i try to run application from my Samsung device, its refusing to connect my IP address.
My IP address is not registered in DNS.
I tried:
1) accessing from url- 127.0.0.1 and localhost
2) modified httpd.conf and httpd-xampp.conf file- changed to Require all granted permission
3) uninstalled my Antivirus
4) changed firewall and proxy setting
5) Created new Inbound Rule in firewall advance security
6) re typed INTERNET permission
7) wrote httpPost.setHeader("Accept", "application/json"); in code
Still Im getting following error:
W/IInputConnectionWrapper(22232): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(22232): setComposingText on inactive InputConnection
W/IInputConnectionWrapper(22232): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(22232): setComposingText on inactive InputConnection
D/request!(22232): starting
W/System.err(22232): org.apache.http.conn.HttpHostConnectException: Connection to
http://192.XXX.X.XXX refused
W/System.err(22232): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:183)
W/System.err(22232): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
W/System.err(22232): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
W/System.err(22232): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
W/System.err(22232): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
W/System.err(22232): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
W/System.err(22232): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
W/System.err(22232): at com.example.mysqltest.JSONParser.makeHttpRequest(JSONParser.java:111)
W/System.err(22232): at com.example.mysqltest.Login$AttemptLogin.doInBackground(Login.java:121)
W/System.err(22232): at com.example.mysqltest.Login$AttemptLogin.doInBackground(Login.java:1)
W/System.err(22232): at android.os.AsyncTask$2.call(AsyncTask.java:287)
W/System.err(22232): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
W/System.err(22232): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
W/System.err(22232): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
W/System.err(22232): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
W/System.err(22232): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
W/System.err(22232): at java.lang.Thread.run(Thread.java:856)
W/System.err(22232): Caused by: java.net.ConnectException: failed to connect to /192.168.0.114 (port 80): connect failed: ETIMEDOUT (Connection timed out)
W/System.err(22232): at libcore.io.IoBridge.connect(IoBridge.java:114)
W/System.err(22232): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
W/System.err(22232): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:460)
W/System.err(22232): at java.net.Socket.connect(Socket.java:832)
W/System.err(22232): at `enter code here`org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
W/System.err(22232): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:144)
W/System.err(22232): ... 16 more
W/System.err(22232): Caused by: libcore.io.ErrnoException: connect failed: ETIMEDOUT (Connection timed out)
W/System.err(22232): at libcore.io.Posix.connect(Native Method)
W/System.err(22232): at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:85)
W/System.err(22232): at libcore.io.IoBridge.connectErrno(IoBridge.java:127)
W/System.err(22232): at libcore.io.IoBridge.connect(IoBridge.java:112)
W/System.err(22232): ... 21 more
E/Buffer Error(22232): Error converting result java.lang.NullPointerException
E/JSON Parser(22232): Error parsing data org.json.JSONException: End of input at character 0 of
W/dalvikvm(22232): threadid=12: thread exiting with uncaught exception (group=0x41180438)
E/AndroidRuntime(22232): FATAL EXCEPTION: AsyncTask #1
E/AndroidRuntime(22232): java.lang.RuntimeException: An error occured while executing doInBackground()
E/AndroidRuntime(22232): at android.os.AsyncTask$3.done(AsyncTask.java:299)
E/AndroidRuntime(22232): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
E/AndroidRuntime(22232): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
E/AndroidRuntime(22232): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
E/AndroidRuntime(22232): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
E/AndroidRuntime(22232): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
E/AndroidRuntime(22232): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
E/AndroidRuntime(22232): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
E/AndroidRuntime(22232): at java.lang.Thread.run(Thread.java:856)
E/AndroidRuntime(22232): Caused by: java.lang.NullPointerException
E/AndroidRuntime(22232): at com.example.mysqltest.Login$AttemptLogin.doInBackground(Login.java:125)
E/AndroidRuntime(22232): at com.example.mysqltest.Login$AttemptLogin.doInBackground(Login.java:1)
E/AndroidRuntime(22232): at android.os.AsyncTask$2.call(AsyncTask.java:287)
E/AndroidRuntime(22232): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
E/AndroidRuntime(22232): ... 5 more
I/Choreographer(22232): Skipped 1143 frames! The application may be doing too much work on its main thread.
E/WindowManager(22232): Activity com.example.mysqltest.Login has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#41bea8a8 that was originally added here
E/WindowManager(22232): android.view.WindowLeaked: Activity com.example.mysqltest.Login has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#41bea8a8 that was originally added here
E/WindowManager(22232): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:419)
E/WindowManager(22232): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:322)
E/WindowManager(22232): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:234)
E/WindowManager(22232): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:153)
E/WindowManager(22232): at android.view.Window$LocalWindowManager.addView(Window.java:557)
E/WindowManager(22232): at android.app.Dialog.show(Dialog.java:277)
E/WindowManager(22232): at com.example.mysqltest.Login$AttemptLogin.onPreExecute(Login.java:103)
E/WindowManager(22232): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:586)
E/WindowManager(22232): at android.os.AsyncTask.execute(AsyncTask.java:534)
E/WindowManager(22232): at com.example.mysqltest.Login.onClick(Login.java:77)
E/WindowManager(22232): at android.view.View.performClick(View.java:4191)
E/WindowManager(22232): at android.view.View$PerformClick.run(View.java:17229)
E/WindowManager(22232): at android.os.Handler.handleCallback(Handler.java:615)
E/WindowManager(22232): at android.os.Handler.dispatchMessage(Handler.java:92)
E/WindowManager(22232): at android.os.Looper.loop(Looper.java:137)
E/WindowManager(22232): at android.app.ActivityThread.main(ActivityThread.java:4960)
E/WindowManager(22232): at java.lang.reflect.Method.invokeNative(Native Method)
E/WindowManager(22232): at java.lang.reflect.Method.invoke(Method.java:511)
E/WindowManager(22232): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
E/WindowManager(22232): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
E/WindowManager(22232): at dalvik.system.NativeStart.main(Native Method)"
Please try to check your local IP address of your PC. Connect the phone to the same network (WIFI). Then use the following address/port to connect to your PC.
In Android:
URL: your_pc_local_ip
PORT: 80 (but I think it is not mandatory)
I use in this way and it is working properly for me.
I have integrated zxing barcode scanner in my app. When the scanner gets a scan it takes the result and searches an external online database via a async task then opens a new activity based on the results. I am getting a force close that is not consistent, it does not happen every scan, only sometimes so I am having trouble figuring out why I am getting a leaked window error, and only sometimes:
09-25 21:02:48.105 24371-24371/com.beerportfolio.beerportfoliopro E/WindowManager﹕ Activity com.example.beerportfoliopro.BeerPage2 has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#424b7198 that was originally added here
android.view.WindowLeaked: Activity com.example.beerportfoliopro.BeerPage2 has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#424b7198 that was originally added here
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:468)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:419)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:351)
at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:171)
at android.view.Window$LocalWindowManager.addView(Window.java:558)
at android.app.Dialog.show(Dialog.java:282)
at com.example.beerportfoliopro.GetBeerRateJSON.onPreExecute(GetBeerRateJSON.java:52)
at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:586)
at android.os.AsyncTask.execute(AsyncTask.java:534)
at com.example.beerportfoliopro.GetBeerDataJSON.onPostExecute(GetBeerDataJSON.java:111)
at com.example.beerportfoliopro.GetBeerDataJSON.onPostExecute(GetBeerDataJSON.java:34)
at android.os.AsyncTask.finish(AsyncTask.java:631)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5536)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1074)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:841)
at dalvik.system.NativeStart.main(Native Method)
09-25 21:02:48.265 24371-24371/com.beerportfolio.beerportfoliopro E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.IllegalArgumentException: View not attached to window manager
at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:784)
at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:476)
at android.view.WindowManagerImpl$CompatModeWrapper.removeView(WindowManagerImpl.java:182)
at android.app.Dialog.dismissDialog(Dialog.java:328)
at android.app.Dialog.dismiss(Dialog.java:311)
at com.example.beerportfoliopro.GetBeerRateJSON.onPostExecute(GetBeerRateJSON.java:74)
at com.example.beerportfoliopro.GetBeerRateJSON.onPostExecute(GetBeerRateJSON.java:27)
at android.os.AsyncTask.finish(AsyncTask.java:631)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5536)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1074)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:841)
at dalvik.system.NativeStart.main(Native Method)
From the stack trace, it looks like your Dialog isn't visible when the AsyncTask finishes its work. In that case, the call to dismiss() will crash the app.
You might try using Dialog.isShowing() to avoid the crash:
protected void onPostExecute(...) {
...
if (dialog.isShowing()) {
dialog.dismiss(); // or .cancel()
}
...
}
Parsing the simple data to textviews asynchronously
Trying to parse JSON to the three text views but getting error
I am applying Asynchronous way of parsing
I have used collection hashmap to store data
Any Ideas on how to successfully parse the JSON to the Textviews
Thanks,
MainActivity.java
public class MainActivity extends Activity {
private static String url1 = "http://54.218.73.244:7002/RestaurantTimings";
private HashMap<Integer, String> contentsMap = new HashMap<Integer, String>();
ProgressDialog progressDialog;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//instantiating progressDialog
progressDialog=new ProgressDialog(MainActivity.this);
new ParsingAsync().execute();
}
private class ParsingAsync extends AsyncTask<Void, Void, Void>{
#Override
protected void onPreExecute() {
// TODO Auto-generated method stub
super.onPreExecute();
progressDialog=ProgressDialog.show(MainActivity.this, "", "Please Wait .. ", true, false);
}
#Override
protected Void doInBackground(Void... params) {
// TODO Auto-generated method stub
JSONObjParser jParser=new JSONObjParser();
JSONArray json1=jParser.getJSONFromUrl(url1);
try{
for(int i=0;i<json1.length();i++){
JSONObject c=json1.getJSONObject(i);
int id = c.getInt("_id");
String TIME = c.getString("RestaurantTime");
contentsMap.put(id,TIME);
}
}catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
#Override
protected void onPostExecute(Void result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
progressDialog.dismiss();
TextView TV1=(TextView) findViewById(R.id.restaurantTimings1);
TV1.setText(contentsMap.get(1));
TextView TV2=(TextView) findViewById(R.id.restaurantTimings2);
TV1.setText(contentsMap.get(2));
TextView TV3=(TextView) findViewById(R.id.restaurantTimings3);
TV1.setText(contentsMap.get(3));
}
}
}
log
08-20 20:40:21.642: W/System.err(482): java.net.SocketException: Permission denied
08-20 20:40:21.642: W/System.err(482): at org.apache.harmony.luni.platform.OSNetworkSystem.socket(Native Method)
08-20 20:40:21.652: W/System.err(482): at dalvik.system.BlockGuard$WrappedNetworkSystem.socket(BlockGuard.java:335)
08-20 20:40:21.652: W/System.err(482): at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:216)
08-20 20:40:21.652: W/System.err(482): at java.net.Socket.checkOpenAndCreate(Socket.java:802)
08-20 20:40:21.652: W/System.err(482): at java.net.Socket.connect(Socket.java:948)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:143)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
08-20 20:40:21.662: W/System.err(482): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
08-20 20:40:21.682: W/System.err(482): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
08-20 20:40:21.692: W/System.err(482): at com.example.simpleasynctask.JSONObjParser.getJSONFromUrl(JSONObjParser.java:40)
08-20 20:40:21.692: W/System.err(482): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:50)
08-20 20:40:21.692: W/System.err(482): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:40:21.692: W/System.err(482): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:40:21.692: W/System.err(482): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:40:21.692: W/System.err(482): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:40:21.702: W/System.err(482): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:40:21.702: W/System.err(482): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:40:21.702: W/System.err(482): at java.lang.Thread.run(Thread.java:1019)
08-20 20:40:21.712: E/Buffer Error(482): Error converting result java.lang.NullPointerException
08-20 20:40:21.712: E/JSON Parser(482): Error parsing data org.json.JSONException: End of input at character 0 of
08-20 20:40:21.722: W/dalvikvm(482): threadid=9: thread exiting with uncaught exception (group=0x40015560)
08-20 20:40:21.732: E/AndroidRuntime(482): FATAL EXCEPTION: AsyncTask #1
08-20 20:40:21.732: E/AndroidRuntime(482): java.lang.RuntimeException: An error occured while executing doInBackground()
08-20 20:40:21.732: E/AndroidRuntime(482): at android.os.AsyncTask$3.done(AsyncTask.java:200)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.lang.Thread.run(Thread.java:1019)
08-20 20:40:21.732: E/AndroidRuntime(482): Caused by: java.lang.NullPointerException
08-20 20:40:21.732: E/AndroidRuntime(482): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:53)
08-20 20:40:21.732: E/AndroidRuntime(482): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:40:21.732: E/AndroidRuntime(482): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:40:21.732: E/AndroidRuntime(482): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:40:21.732: E/AndroidRuntime(482): ... 4 more
08-20 20:40:22.722: E/WindowManager(482): Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e148 that was originally added here
08-20 20:40:22.722: E/WindowManager(482): android.view.WindowLeaked: Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e148 that was originally added here
08-20 20:40:22.722: E/WindowManager(482): at android.view.ViewRoot.<init>(ViewRoot.java:258)
08-20 20:40:22.722: E/WindowManager(482): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
08-20 20:40:22.722: E/WindowManager(482): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
08-20 20:40:22.722: E/WindowManager(482): at android.view.Window$LocalWindowManager.addView(Window.java:424)
08-20 20:40:22.722: E/WindowManager(482): at android.app.Dialog.show(Dialog.java:241)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ProgressDialog.show(ProgressDialog.java:107)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ProgressDialog.show(ProgressDialog.java:95)
08-20 20:40:22.722: E/WindowManager(482): at com.example.simpleasynctask.MainActivity$ParsingAsync.onPreExecute(MainActivity.java:43)
08-20 20:40:22.722: E/WindowManager(482): at android.os.AsyncTask.execute(AsyncTask.java:391)
08-20 20:40:22.722: E/WindowManager(482): at com.example.simpleasynctask.MainActivity.onCreate(MainActivity.java:34)
08-20 20:40:22.722: E/WindowManager(482): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-20 20:40:22.722: E/WindowManager(482): at android.os.Handler.dispatchMessage(Handler.java:99)
08-20 20:40:22.722: E/WindowManager(482): at android.os.Looper.loop(Looper.java:123)
08-20 20:40:22.722: E/WindowManager(482): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-20 20:40:22.722: E/WindowManager(482): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 20:40:22.722: E/WindowManager(482): at java.lang.reflect.Method.invoke(Method.java:507)
08-20 20:40:22.722: E/WindowManager(482): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-20 20:40:22.722: E/WindowManager(482): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-20 20:40:22.722: E/WindowManager(482): at dalvik.system.NativeStart.main(Native Method)
08-20 20:45:21.996: I/Process(482): Sending signal. PID: 482 SIG: 9
08-20 20:47:11.752: W/System.err(519): java.net.SocketException: Permission denied
08-20 20:47:11.772: W/System.err(519): at org.apache.harmony.luni.platform.OSNetworkSystem.socket(Native Method)
08-20 20:47:11.782: W/System.err(519): at dalvik.system.BlockGuard$WrappedNetworkSystem.socket(BlockGuard.java:335)
08-20 20:47:11.782: W/System.err(519): at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:216)
08-20 20:47:11.782: W/System.err(519): at java.net.Socket.checkOpenAndCreate(Socket.java:802)
08-20 20:47:11.782: W/System.err(519): at java.net.Socket.connect(Socket.java:948)
08-20 20:47:11.782: W/System.err(519): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
08-20 20:47:11.782: W/System.err(519): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:143)
08-20 20:47:11.782: W/System.err(519): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
08-20 20:47:11.792: W/System.err(519): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
08-20 20:47:11.792: W/System.err(519): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
08-20 20:47:11.803: W/System.err(519): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
08-20 20:47:11.803: W/System.err(519): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
08-20 20:47:11.803: W/System.err(519): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
08-20 20:47:11.803: W/System.err(519): at com.example.simpleasynctask.JSONObjParser.getJSONFromUrl(JSONObjParser.java:40)
08-20 20:47:11.812: W/System.err(519): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:50)
08-20 20:47:11.812: W/System.err(519): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:47:11.812: W/System.err(519): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:47:11.853: W/System.err(519): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:47:11.853: W/System.err(519): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:47:11.853: W/System.err(519): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:47:11.853: W/System.err(519): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:47:11.862: W/System.err(519): at java.lang.Thread.run(Thread.java:1019)
08-20 20:47:11.862: E/Buffer Error(519): Error converting result java.lang.NullPointerException
08-20 20:47:11.892: E/JSON Parser(519): Error parsing data org.json.JSONException: End of input at character 0 of
08-20 20:47:11.904: W/dalvikvm(519): threadid=9: thread exiting with uncaught exception (group=0x40015560)
08-20 20:47:11.912: E/AndroidRuntime(519): FATAL EXCEPTION: AsyncTask #1
08-20 20:47:11.912: E/AndroidRuntime(519): java.lang.RuntimeException: An error occured while executing doInBackground()
08-20 20:47:11.912: E/AndroidRuntime(519): at android.os.AsyncTask$3.done(AsyncTask.java:200)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.lang.Thread.run(Thread.java:1019)
08-20 20:47:11.912: E/AndroidRuntime(519): Caused by: java.lang.NullPointerException
08-20 20:47:11.912: E/AndroidRuntime(519): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:53)
08-20 20:47:11.912: E/AndroidRuntime(519): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:47:11.912: E/AndroidRuntime(519): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:47:11.912: E/AndroidRuntime(519): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:47:11.912: E/AndroidRuntime(519): ... 4 more
08-20 20:47:14.072: E/WindowManager(519): Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e498 that was originally added here
08-20 20:47:14.072: E/WindowManager(519): android.view.WindowLeaked: Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e498 that was originally added here
08-20 20:47:14.072: E/WindowManager(519): at android.view.ViewRoot.<init>(ViewRoot.java:258)
08-20 20:47:14.072: E/WindowManager(519): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
08-20 20:47:14.072: E/WindowManager(519): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
08-20 20:47:14.072: E/WindowManager(519): at android.view.Window$LocalWindowManager.addView(Window.java:424)
08-20 20:47:14.072: E/WindowManager(519): at android.app.Dialog.show(Dialog.java:241)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ProgressDialog.show(ProgressDialog.java:107)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ProgressDialog.show(ProgressDialog.java:95)
08-20 20:47:14.072: E/WindowManager(519): at com.example.simpleasynctask.MainActivity$ParsingAsync.onPreExecute(MainActivity.java:43)
08-20 20:47:14.072: E/WindowManager(519): at android.os.AsyncTask.execute(AsyncTask.java:391)
08-20 20:47:14.072: E/WindowManager(519): at com.example.simpleasynctask.MainActivity.onCreate(MainActivity.java:34)
08-20 20:47:14.072: E/WindowManager(519): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-20 20:47:14.072: E/WindowManager(519): at android.os.Handler.dispatchMessage(Handler.java:99)
08-20 20:47:14.072: E/WindowManager(519): at android.os.Looper.loop(Looper.java:123)
08-20 20:47:14.072: E/WindowManager(519): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-20 20:47:14.072: E/WindowManager(519): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 20:47:14.072: E/WindowManager(519): at java.lang.reflect.Method.invoke(Method.java:507)
08-20 20:47:14.072: E/WindowManager(519): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-20 20:47:14.072: E/WindowManager(519): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-20 20:47:14.072: E/WindowManager(519): at dalvik.system.NativeStart.main(Native Method)
08-20 20:49:38.402: W/System.err(555): java.net.SocketException: Permission denied
08-20 20:49:38.434: W/System.err(555): at org.apache.harmony.luni.platform.OSNetworkSystem.socket(Native Method)
08-20 20:49:38.452: W/System.err(555): at dalvik.system.BlockGuard$WrappedNetworkSystem.socket(BlockGuard.java:335)
08-20 20:49:38.452: W/System.err(555): at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:216)
08-20 20:49:38.452: W/System.err(555): at java.net.Socket.checkOpenAndCreate(Socket.java:802)
08-20 20:49:38.452: W/System.err(555): at java.net.Socket.connect(Socket.java:948)
08-20 20:49:38.452: W/System.err(555): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
08-20 20:49:38.452: W/System.err(555): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:143)
08-20 20:49:38.477: W/System.err(555): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
08-20 20:49:38.482: W/System.err(555): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
08-20 20:49:38.482: W/System.err(555): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:359)
08-20 20:49:38.482: W/System.err(555): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
08-20 20:49:38.482: W/System.err(555): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
08-20 20:49:38.492: W/System.err(555): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
08-20 20:49:38.492: W/System.err(555): at com.example.simpleasynctask.JSONObjParser.getJSONFromUrl(JSONObjParser.java:40)
08-20 20:49:38.502: W/System.err(555): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:50)
08-20 20:49:38.522: W/System.err(555): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:49:38.522: W/System.err(555): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:49:38.532: W/System.err(555): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:49:38.542: W/System.err(555): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:49:38.542: W/System.err(555): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:49:38.552: W/System.err(555): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:49:38.552: W/System.err(555): at java.lang.Thread.run(Thread.java:1019)
08-20 20:49:38.563: E/Buffer Error(555): Error converting result java.lang.NullPointerException
08-20 20:49:38.582: E/JSON Parser(555): Error parsing data org.json.JSONException: End of input at character 0 of
08-20 20:49:38.632: W/dalvikvm(555): threadid=9: thread exiting with uncaught exception (group=0x40015560)
08-20 20:49:38.642: E/AndroidRuntime(555): FATAL EXCEPTION: AsyncTask #1
08-20 20:49:38.642: E/AndroidRuntime(555): java.lang.RuntimeException: An error occured while executing doInBackground()
08-20 20:49:38.642: E/AndroidRuntime(555): at android.os.AsyncTask$3.done(AsyncTask.java:200)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.lang.Thread.run(Thread.java:1019)
08-20 20:49:38.642: E/AndroidRuntime(555): Caused by: java.lang.NullPointerException
08-20 20:49:38.642: E/AndroidRuntime(555): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:53)
08-20 20:49:38.642: E/AndroidRuntime(555): at com.example.simpleasynctask.MainActivity$ParsingAsync.doInBackground(MainActivity.java:1)
08-20 20:49:38.642: E/AndroidRuntime(555): at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-20 20:49:38.642: E/AndroidRuntime(555): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-20 20:49:38.642: E/AndroidRuntime(555): ... 4 more
08-20 20:49:40.662: E/WindowManager(555): Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e7f0 that was originally added here
08-20 20:49:40.662: E/WindowManager(555): android.view.WindowLeaked: Activity com.example.simpleasynctask.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView#4051e7f0 that was originally added here
08-20 20:49:40.662: E/WindowManager(555): at android.view.ViewRoot.<init>(ViewRoot.java:258)
08-20 20:49:40.662: E/WindowManager(555): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
08-20 20:49:40.662: E/WindowManager(555): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
08-20 20:49:40.662: E/WindowManager(555): at android.view.Window$LocalWindowManager.addView(Window.java:424)
08-20 20:49:40.662: E/WindowManager(555): at android.app.Dialog.show(Dialog.java:241)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ProgressDialog.show(ProgressDialog.java:107)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ProgressDialog.show(ProgressDialog.java:95)
08-20 20:49:40.662: E/WindowManager(555): at com.example.simpleasynctask.MainActivity$ParsingAsync.onPreExecute(MainActivity.java:43)
08-20 20:49:40.662: E/WindowManager(555): at android.os.AsyncTask.execute(AsyncTask.java:391)
08-20 20:49:40.662: E/WindowManager(555): at com.example.simpleasynctask.MainActivity.onCreate(MainActivity.java:34)
08-20 20:49:40.662: E/WindowManager(555): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-20 20:49:40.662: E/WindowManager(555): at android.os.Handler.dispatchMessage(Handler.java:99)
08-20 20:49:40.662: E/WindowManager(555): at android.os.Looper.loop(Looper.java:123)
08-20 20:49:40.662: E/WindowManager(555): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-20 20:49:40.662: E/WindowManager(555): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 20:49:40.662: E/WindowManager(555): at java.lang.reflect.Method.invoke(Method.java:507)
08-20 20:49:40.662: E/WindowManager(555): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-20 20:49:40.662: E/WindowManager(555): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-20 20:49:40.662: E/WindowManager(555): at dalvik.system.NativeStart.main(Native Method)
UPDATE
After adding internet permission
No errors in error log
But i cannot populate the remaining two text views
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="#+id/restaurantTimings1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="TextView" />
<TextView
android:id="#+id/restaurantTimings2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView2"
android:layout_centerHorizontal="true"
android:layout_marginTop="133dp"
android:text="TextView" />
<TextView
android:id="#+id/restaurantTimings3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/restaurantTimings2"
android:layout_alignLeft="#+id/restaurantTimings2"
android:layout_marginBottom="68dp"
android:text="TextView" />
</RelativeLayout>
Firstly,
From your logs :- java.net.SocketException: Permission denied its
clear you haven't added internet permissions, so you have to add
<uses-permission android:name="android.permission.INTERNET"/> in
your manifest file
Secondly
you haven't setText to your other TextView.. refer below code,..
#Override
protected void onPostExecute(Void result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
progressDialog.dismiss();
TextView TV1=(TextView) findViewById(R.id.restaurantTimings1);
TV1.setText(contentsMap.get(1));
TextView TV2=(TextView) findViewById(R.id.restaurantTimings2);
TV2.setText(contentsMap.get(2));//Here........
TextView TV3=(TextView) findViewById(R.id.restaurantTimings3);
TV3.setText(contentsMap.get(3));//Here.........
}
I have UnknownHostExeption, when i am using proxy. My App works finy in networks without proxy or with some proxies( not everyone).
I am aware that I need to setup proxy setings for networks with them
for device: wify settings - advance - wifi proxy
emulator: wireless networks - mobile networks - access points - telkia - proxy|port.
I wish to know which essential options I have to ask admins to unlock for stable network comunications.
07-18 08:51:26.780: W/System.err(302): java.net.UnknownHostException: mirkvartir.ua
07-18 08:51:26.780: W/System.err(302): at java.net.InetAddress.lookupHostByName(InetAddress.java:513)
07-18 08:51:26.780: W/System.err(302): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)
07-18 08:51:26.780: W/System.err(302): at java.net.InetAddress.getAllByName(InetAddress.java:242)
07-18 08:51:26.780: W/System.err(302): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
07-18 08:51:26.780: W/System.err(302): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
07-18 08:51:26.780: W/System.err(302): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
07-18 08:51:26.780: W/System.err(302): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
07-18 08:51:26.780: W/System.err(302): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
07-18 08:51:26.780: W/System.err(302): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
07-18 08:51:26.780: W/System.err(302): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
07-18 08:51:26.780: W/System.err(302): at ua.mirkvartir.android.frontend.adapter.JSONParser.getJSONFromUrl(JSONParser.java:98)
07-18 08:51:26.780: W/System.err(302): at ua.mirkvartir.android.frontend.adapter.UserFunctions.loginUser(UserFunctions.java:76)
07-18 08:51:26.787: W/System.err(302): at ua.mirkvartir.android.frontend.LoginActivity$Login.doInBackground(LoginActivity.java:185)
07-18 08:51:26.787: W/System.err(302): at ua.mirkvartir.android.frontend.LoginActivity$Login.doInBackground(LoginActivity.java:1)
07-18 08:51:26.787: W/System.err(302): at android.os.AsyncTask$2.call(AsyncTask.java:185)
07-18 08:51:26.787: W/System.err(302): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
07-18 08:51:26.787: W/System.err(302): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
07-18 08:51:26.787: W/System.err(302): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
07-18 08:51:26.787: W/System.err(302): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
07-18 08:51:26.787: W/System.err(302): at java.lang.Thread.run(Thread.java:1096)
Answer is, you cannot tell in general. This is not Android-specific, but depends on your App. You're free to choose the ports it communicates over. Usually, 80 and 443 shouldn't be blocked (http / https) - everything else depends on your App.
What services do you use? If you never specified a port explicitly, they might imply one.
I'm getting that exception when I pick a wallpaper. I'm actually not sure what function is the culprit. Here's the error log:
I/ActivityManager( 1360): Starting activity: Intent { cmp=com.android.wallpaper.livepicker/.LiveWallpaperPreview (has extras) }
W/dalvikvm(29175): threadid=1: thread exiting with uncaught exception (group=0x40020ac0)
E/AndroidRuntime(29175): FATAL EXCEPTION: main
E/AndroidRuntime(29175): java.lang.IllegalStateException: AssetManager has been finalized!
E/AndroidRuntime(29175): at android.content.res.AssetManager.isUpToDate(Native Method)
E/AndroidRuntime(29175): at android.app.ActivityThread.getPackageInfo(ActivityThread.java:2350)
E/AndroidRuntime(29175): at android.app.ActivityThread.getPackageInfoNoCheck(ActivityThread.java:2337)
E/AndroidRuntime(29175): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2935)
E/AndroidRuntime(29175): at android.app.ActivityThread.access$3300(ActivityThread.java:125)
E/AndroidRuntime(29175): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
E/AndroidRuntime(29175): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(29175): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(29175): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(29175): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(29175): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(29175): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
E/AndroidRuntime(29175): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
E/AndroidRuntime(29175): at dalvik.system.NativeStart.main(Native Method)
I/ActivityManager( 1360): Displayed activity com.android.wallpaper.livepicker/.LiveWallpaperPreview: 331 ms (total 331 ms)
W/InputManagerService( 1360): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#44bf5a08
I/ActivityManager( 1360): Process com.bukabros.videolivewallpaper (pid 29175) has died.
W/ActivityManager( 1360): Scheduling restart of crashed service com.bukabros.videolivewallpaper/.VideoLiveWallpaper in 5000ms
I/ActivityManager( 1360): Start proc com.bukabros.videolivewallpaper for service com.bukabros.videolivewallpaper/.VideoLiveWallpaper: pid=29207 uid=10090 gids={}
The only thing I can think of is that onCreate doesn't get called in the right order when the wallpaper gets picked cuz that's where I instantiate the asset manager.
And yes, I'm using the NDK but the asset manager doesn't get used there.
Ah nevermind. The culprit was that the handle to the assetmanager was a static variable. (That was just a quick hack for something else). Making that a normal variable solved the problem.