parsing data into Textviews in android - android

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.........
}

Related

Fragment Tabhost Error: java.lang.IllegalStateException: No tab known for tag null When Internet Connection not available

I Am first checking the internet connection and after that I am starting my Activity and I face this problem when I use the Tab Host.
I am also put my adding tab host code in the try catch but it don't even catch the exception.
XML Code:
<android.support.v4.app.FragmentTabHost
android:id="#android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#999999"
>
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0" />
</android.support.v4.app.FragmentTabHost>
My java Code
cd = new ConnectionDetector(Alumni_MainActivity.this);
// Check if Internet present
if (!cd.isConnectingToInternet()) {
// Internet Connection is not present
alert.showAlertDialog(Alumni_MainActivity.this,
"Internet Connection Error",
"Please connect to working Internet connection", false);
// stop executing code by return
return;
}
try {
tabHost = (FragmentTabHost) findViewById(android.R.id.tabhost);
tabHost.setup(this, getSupportFragmentManager(), R.id.fragment_container);
addTab("Chat", R.drawable.chaticon, ChatRoom.class, tabHost,null);
addTab("Contacts", R.drawable.contacticon, Memeber_view.class, tabHost, null);
addTab("Gallery", R.drawable.gallery, Galler_View.class, tabHost, null);
addTab("Event", R.drawable.event, EventList.class, tabHost,null);
addTab("More", R.drawable.moreicon, More.class, tabHost,null);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Error:
08-20 10:02:04.195: E/AndroidRuntime(13462): FATAL EXCEPTION: main
08-20 10:02:04.195: E/AndroidRuntime(13462): java.lang.IllegalStateException: No tab known for tag null
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.support.v4.app.FragmentTabHost.doTabChanged(FragmentTabHost.java:330)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.support.v4.app.FragmentTabHost.onAttachedToWindow(FragmentTabHost.java:280)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.View.dispatchAttachedToWindow(View.java:11988)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2495)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2502)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2502)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2502)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2502)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1363)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4879)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.Choreographer.doCallbacks(Choreographer.java:579)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.Choreographer.doFrame(Choreographer.java:548)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.os.Handler.handleCallback(Handler.java:725)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.os.Handler.dispatchMessage(Handler.java:92)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.os.Looper.loop(Looper.java:153)
08-20 10:02:04.195: E/AndroidRuntime(13462): at android.app.ActivityThread.main(ActivityThread.java:5311)
08-20 10:02:04.195: E/AndroidRuntime(13462): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 10:02:04.195: E/AndroidRuntime(13462): at java.lang.reflect.Method.invoke(Method.java:511)
08-20 10:02:04.195: E/AndroidRuntime(13462): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
08-20 10:02:04.195: E/AndroidRuntime(13462): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
08-20 10:02:04.195: E/AndroidRuntime(13462): at dalvik.system.NativeStart.main(Native Method)
Please help me I am struck.
Thanks in Advance!!

class not found exception in android

I am using following code for SQLConnection in android:
public void queryResultSet(String CommandSQL) throws ClassNotFoundException, java.sql.SQLException
{
ResultSet rs;
Connection conn = null;
Toast msg1 = Toast.makeText(getBaseContext(),
"Name = " + CommandSQL, Toast.LENGTH_LONG);
msg1.show();
Class.forName("net.sourceforge.jtds.jdbc.Driver");
String username="14Graficali\\Administrator";
String ConnUrl="jdbc:jtds:sqlserver://14GRAFICALI\\MSSQLSERVER2008;DatabaseName=DVDKiosk;user=14Graficali\\Administrator;Instance=SQLExpress";
conn = DriverManager.getConnection(ConnUrl);
Statement st=conn.createStatement();
rs=st.executeQuery(CommandSQL);
while(rs.next())
{
Toast msg2 = Toast.makeText(getBaseContext(),
"Name = " + rs.getString("UserName"), Toast.LENGTH_LONG);
msg2.show();
}
}
I have included net.sourceforge.jtds.jdbc.Driver as we can see below :
Stack Trace:
08-20 10:57:42.087: W/System.err(400): java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver
08-20 10:57:42.087: W/System.err(400): at java.lang.Class.classForName(Native Method)
08-20 10:57:42.087: W/System.err(400): at java.lang.Class.forName(Class.java:234)
08-20 10:57:42.087: W/System.err(400): at java.lang.Class.forName(Class.java:181)
08-20 10:57:42.087: W/System.err(400): at com.example.registrationapp.Login.queryResultSet(Login.java:93)
08-20 10:57:42.087: W/System.err(400): at com.example.registrationapp.Login$1.onClick(Login.java:126)
08-20 10:57:42.087: W/System.err(400): at android.view.View.performClick(View.java:2485)
08-20 10:57:42.087: W/System.err(400): at android.view.View$PerformClick.run(View.java:9080)
08-20 10:57:42.087: W/System.err(400): at android.os.Handler.handleCallback(Handler.java:587)
08-20 10:57:42.087: W/System.err(400): at android.os.Handler.dispatchMessage(Handler.java:92)
08-20 10:57:42.098: W/System.err(400): at android.os.Looper.loop(Looper.java:123)
08-20 10:57:42.098: W/System.err(400): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-20 10:57:42.098: W/System.err(400): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 10:57:42.098: W/System.err(400): at java.lang.reflect.Method.invoke(Method.java:507)
08-20 10:57:42.098: W/System.err(400): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-20 10:57:42.098: W/System.err(400): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-20 10:57:42.098: W/System.err(400): at dalvik.system.NativeStart.main(Native Method)
08-20 10:57:42.098: W/System.err(400): Caused by: java.lang.NoClassDefFoundError: net.sourceforge.jtds.jdbc.Driver
08-20 10:57:42.107: W/System.err(400): ... 16 more
08-20 10:57:42.107: W/System.err(400): Caused by: java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver in loader dalvik.system.PathClassLoader[/data/app/com.example.registrationapp-1.apk]
08-20 10:57:42.107: W/System.err(400): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
08-20 10:57:42.107: W/System.err(400): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
08-20 10:57:42.107: W/System.err(400): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
Please help me.
If you have already added the jtds-1.2.5 driver, good. Otherwise:
Right click on the Project > Properties > Libraries Tab Add the jtds-1.2.5.jar file by clicking on "Add External JARs"
Next, in the Order and Export tab (Right next to Libraries in the Java Build Path window) check the box for jtds-1.2.5.jar (and any other external jars you might have).
This will export the .jar containing the driver with the .apk file.
If you use ProGuard, then your class may be dropped by it because it is used with reflection only. And if you don't, Android can still fail to load class for some reasons. Look at LogCat during your package installation.
right click on the project - properties - java build path - Order and export - tick Android private libraries and all the libraries that u added

Error inflating jfeinstein sliding menu class

I have an app where there is a sliding menu. I have implemented it using the jfeinstein's library. It was working perfectly fine till yesterday but it has stopped working now. I haven't even made any changes to the code. Here is the error report:
08-20 15:02:52.060: E/AndroidRuntime(32366): FATAL EXCEPTION: main
08-20 15:02:52.060: E/AndroidRuntime(32366): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cvapp/com.cvapp.SecondActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class com.jeremyfeinstein.slidingmenu.lib.SlidingMenu
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread.access$600(ActivityThread.java:140)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.os.Handler.dispatchMessage(Handler.java:99)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.os.Looper.loop(Looper.java:137)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread.main(ActivityThread.java:4898)
08-20 15:02:52.060: E/AndroidRuntime(32366): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 15:02:52.060: E/AndroidRuntime(32366): at java.lang.reflect.Method.invoke(Method.java:511)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
08-20 15:02:52.060: E/AndroidRuntime(32366): at dalvik.system.NativeStart.main(Native Method)
08-20 15:02:52.060: E/AndroidRuntime(32366): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class com.jeremyfeinstein.slidingmenu.lib.SlidingMenu
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityHelper.onCreate(SlidingActivityHelper.java:45)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivity.onCreate(SlidingActivity.java:22)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.cvapp.SecondActivity.onCreate(SecondActivity.java:19)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.Activity.performCreate(Activity.java:5206)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
08-20 15:02:52.060: E/AndroidRuntime(32366): ... 11 more
08-20 15:02:52.060: E/AndroidRuntime(32366): Caused by: java.lang.reflect.InvocationTargetException
08-20 15:02:52.060: E/AndroidRuntime(32366): at java.lang.reflect.Constructor.constructNative(Native Method)
08-20 15:02:52.060: E/AndroidRuntime(32366): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
08-20 15:02:52.060: E/AndroidRuntime(32366): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
08-20 15:02:52.060: E/AndroidRuntime(32366): ... 21 more
08-20 15:02:52.060: E/AndroidRuntime(32366): Caused by: java.lang.NoClassDefFoundError: android.support.v4.view.ViewConfigurationCompat
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.initCustomViewAbove(CustomViewAbove.java:167)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:157)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.CustomViewAbove.<init>(CustomViewAbove.java:152)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:209)
08-20 15:02:52.060: E/AndroidRuntime(32366): at com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.<init>(SlidingMenu.java:192)
08-20 15:02:52.060: E/AndroidRuntime(32366): ... 24 more
Here is my code:
main:
package com.cvapp;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivity;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
public class SecondActivity extends SlidingActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
setBehindContentView(R.layout.activity_menu1);
getSlidingMenu().setBehindOffset(100);
SlidingMenu menu = getSlidingMenu();
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
setOnClickListener();
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.second, menu);
return true;
}
}
xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="#drawable/pic9"
android:clickable="true"
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=".SecondActivity" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="16dp"
android:layout_marginTop="27dp"
android:text="Hello"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
And, if it helps, I have followed this tutorial to set up the Sliding Menu.
FYI, you'd better add support package v4 from library project, instead of copy it to local libs. And remember to add library to your sliding menu application.
Finally I got it.. u just have to right click on your project > Android Tools > Add Support Library, so the prblem was the missing support package v4..
I have got the same issue and I have resolved finally Opening the gradle.properties and added following:
android.enableAapt2=false

Android http-request causes Error - sitting since 3 days

I am sitting since 3 days, looking everywhere on net but it dosnt work ... every time I try to make a http-request on android: it comes the error: unfourtunately, ... has stopped. here my code:
package sd.s;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class SdsdActivity extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Thread trd = new Thread(new Runnable(){
public void run(){
// Creating HTTP client
HttpClient httpClient = new DefaultHttpClient();
// Creating HTTP Post
HttpPost httpPost = new HttpPost(
"http://www.test.com");
// Building post parameters
// key and value pair
List<NameValuePair> nameValuePair = new ArrayList<NameValuePair>(2);
nameValuePair.add(new BasicNameValuePair("test", "test"));
nameValuePair.add(new BasicNameValuePair("message",
"Hi, trying Android HTTP post!"));
// Url Encoding the POST parameters
try {
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair));
} catch (UnsupportedEncodingException e) {
// writing error to Log
e.printStackTrace();
}
// Making HTTP Request
try {
HttpResponse response = httpClient.execute(httpPost);
// writing response to log
Log.d("Http Response:", response.toString());
} catch (ClientProtocolException e) {
// writing exception to log
e.printStackTrace();
} catch (IOException e) {
// writing exception to log
e.printStackTrace();
}
} });
trd.run();
}
}
here my output on LogCat
02-24 17:53:39.003: D/dalvikvm(516): Not late-enabling CheckJNI (already on)
02-24 17:53:40.293: D/AndroidRuntime(516): Shutting down VM
02-24 17:53:40.304: W/dalvikvm(516): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
02-24 17:53:40.313: E/AndroidRuntime(516): FATAL EXCEPTION: main
02-24 17:53:40.313: E/AndroidRuntime(516): java.lang.RuntimeException: Unable to start activity ComponentInfo{sd.s/sd.s.SdsdActivity}: android.os.NetworkOnMainThreadException
02-24 17:53:40.313: E/AndroidRuntime(516): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
02-24 17:53:40.313: E/AndroidRuntime(516): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
02-24 17:53:40.313: E/AndroidRuntime(516): at android.app.ActivityThread.access$600(ActivityThread.java:123)
02-24 17:53:40.313: E/AndroidRuntime(516): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
02-24 17:53:40.313: E/AndroidRuntime(516): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 17:53:40.313: E/AndroidRuntime(516): at android.os.Looper.loop(Looper.java:137)
02-24 17:53:40.313: E/AndroidRuntime(516): at android.app.ActivityThread.main(ActivityThread.java:4424)
02-24 17:53:40.313: E/AndroidRuntime(516): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 17:53:40.313: E/AndroidRuntime(516): at java.lang.reflect.Method.invoke(Method.java:511)
02-24 17:53:40.313: E/AndroidRuntime(516): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-24 17:53:40.313: E/AndroidRuntime(516): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-24 17:53:40.313: E/AndroidRuntime(516): at dalvik.system.NativeStart.main(Native Method)
02-24 17:53:40.313: E/AndroidRuntime(516): Caused by: android.os.NetworkOnMainThreadException
02-24 17:53:40.313: E/AndroidRuntime(516): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099)
02-24 17:53:40.313: E/AndroidRuntime(516): at java.net.InetAddress.lookupHostByName(InetAddress.java:391)
02-24 17:53:40.313: E/AndroidRuntime(516): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:242)
02-24 17:53:40.313: E/AndroidRuntime(516): at java.net.InetAddress.getAllByName(InetAddress.java:220)
02-24 17:53:40.313: E/AndroidRuntime(516): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
02-24 17:53:40.313: E/AndroidRuntime(516): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
02-24 17:53:40.313: E/AndroidRuntime(516): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
02-24 17:53:40.313: E/AndroidRuntime(516): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
02-24 17:53:40.313: E/AndroidRuntime(516): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
02-24 17:53:40.313: E/AndroidRuntime(516): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
02-24 17:53:40.313: E/AndroidRuntime(516): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
02-24 17:53:40.313: E/AndroidRuntime(516): at sd.s.SdsdActivity.onCreate(SdsdActivity.java:52)
02-24 17:53:40.313: E/AndroidRuntime(516): at android.app.Activity.performCreate(Activity.java:4465)
02-24 17:53:40.313: E/AndroidRuntime(516): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
02-24 17:53:40.313: E/AndroidRuntime(516): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
02-24 17:53:40.313: E/AndroidRuntime(516): ... 11 more
02-24 17:59:31.783: D/AndroidRuntime(584): Shutting down VM
02-24 17:59:31.783: W/dalvikvm(584): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
02-24 17:59:31.793: E/AndroidRuntime(584): FATAL EXCEPTION: main
02-24 17:59:31.793: E/AndroidRuntime(584): java.lang.RuntimeException: Unable to start activity ComponentInfo{sd.s/sd.s.SdsdActivity}: android.os.NetworkOnMainThreadException
02-24 17:59:31.793: E/AndroidRuntime(584): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
02-24 17:59:31.793: E/AndroidRuntime(584): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
02-24 17:59:31.793: E/AndroidRuntime(584): at android.app.ActivityThread.access$600(ActivityThread.java:123)
02-24 17:59:31.793: E/AndroidRuntime(584): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
02-24 17:59:31.793: E/AndroidRuntime(584): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 17:59:31.793: E/AndroidRuntime(584): at android.os.Looper.loop(Looper.java:137)
02-24 17:59:31.793: E/AndroidRuntime(584): at android.app.ActivityThread.main(ActivityThread.java:4424)
02-24 17:59:31.793: E/AndroidRuntime(584): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 17:59:31.793: E/AndroidRuntime(584): at java.lang.reflect.Method.invoke(Method.java:511)
02-24 17:59:31.793: E/AndroidRuntime(584): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-24 17:59:31.793: E/AndroidRuntime(584): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-24 17:59:31.793: E/AndroidRuntime(584): at dalvik.system.NativeStart.main(Native Method)
02-24 17:59:31.793: E/AndroidRuntime(584): Caused by: android.os.NetworkOnMainThreadException
02-24 17:59:31.793: E/AndroidRuntime(584): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099)
02-24 17:59:31.793: E/AndroidRuntime(584): at java.net.InetAddress.lookupHostByName(InetAddress.java:391)
02-24 17:59:31.793: E/AndroidRuntime(584): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:242)
02-24 17:59:31.793: E/AndroidRuntime(584): at java.net.InetAddress.getAllByName(InetAddress.java:220)
02-24 17:59:31.793: E/AndroidRuntime(584): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
02-24 17:59:31.793: E/AndroidRuntime(584): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
02-24 17:59:31.793: E/AndroidRuntime(584): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
02-24 17:59:31.793: E/AndroidRuntime(584): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
02-24 17:59:31.793: E/AndroidRuntime(584): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
02-24 17:59:31.793: E/AndroidRuntime(584): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
02-24 17:59:31.793: E/AndroidRuntime(584): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
02-24 17:59:31.793: E/AndroidRuntime(584): at sd.s.SdsdActivity$1.run(SdsdActivity.java:53)
02-24 17:59:31.793: E/AndroidRuntime(584): at java.lang.Thread.run(Thread.java:856)
02-24 17:59:31.793: E/AndroidRuntime(584): at sd.s.SdsdActivity.onCreate(SdsdActivity.java:66)
02-24 17:59:31.793: E/AndroidRuntime(584): at android.app.Activity.performCreate(Activity.java:4465)
02-24 17:59:31.793: E/AndroidRuntime(584): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
02-24 17:59:31.793: E/AndroidRuntime(584): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
02-24 17:59:31.793: E/AndroidRuntime(584): ... 11 more
02-24 18:08:12.242: D/AndroidRuntime(626): Shutting down VM
02-24 18:08:12.242: W/dalvikvm(626): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
02-24 18:08:12.262: E/AndroidRuntime(626): FATAL EXCEPTION: main
02-24 18:08:12.262: E/AndroidRuntime(626): java.lang.RuntimeException: Unable to start activity ComponentInfo{sd.s/sd.s.SdsdActivity}: android.os.NetworkOnMainThreadException
02-24 18:08:12.262: E/AndroidRuntime(626): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
02-24 18:08:12.262: E/AndroidRuntime(626): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
02-24 18:08:12.262: E/AndroidRuntime(626): at android.app.ActivityThread.access$600(ActivityThread.java:123)
02-24 18:08:12.262: E/AndroidRuntime(626): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
02-24 18:08:12.262: E/AndroidRuntime(626): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 18:08:12.262: E/AndroidRuntime(626): at android.os.Looper.loop(Looper.java:137)
02-24 18:08:12.262: E/AndroidRuntime(626): at android.app.ActivityThread.main(ActivityThread.java:4424)
02-24 18:08:12.262: E/AndroidRuntime(626): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 18:08:12.262: E/AndroidRuntime(626): at java.lang.reflect.Method.invoke(Method.java:511)
02-24 18:08:12.262: E/AndroidRuntime(626): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-24 18:08:12.262: E/AndroidRuntime(626): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-24 18:08:12.262: E/AndroidRuntime(626): at dalvik.system.NativeStart.main(Native Method)
02-24 18:08:12.262: E/AndroidRuntime(626): Caused by: android.os.NetworkOnMainThreadException
02-24 18:08:12.262: E/AndroidRuntime(626): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099)
02-24 18:08:12.262: E/AndroidRuntime(626): at java.net.InetAddress.lookupHostByName(InetAddress.java:391)
02-24 18:08:12.262: E/AndroidRuntime(626): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:242)
02-24 18:08:12.262: E/AndroidRuntime(626): at java.net.InetAddress.getAllByName(InetAddress.java:220)
02-24 18:08:12.262: E/AndroidRuntime(626): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
02-24 18:08:12.262: E/AndroidRuntime(626): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
02-24 18:08:12.262: E/AndroidRuntime(626): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
02-24 18:08:12.262: E/AndroidRuntime(626): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
02-24 18:08:12.262: E/AndroidRuntime(626): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
02-24 18:08:12.262: E/AndroidRuntime(626): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
02-24 18:08:12.262: E/AndroidRuntime(626): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
02-24 18:08:12.262: E/AndroidRuntime(626): at sd.s.SdsdActivity$1.run(SdsdActivity.java:53)
02-24 18:08:12.262: E/AndroidRuntime(626): at java.lang.Thread.run(Thread.java:856)
02-24 18:08:12.262: E/AndroidRuntime(626): at sd.s.SdsdActivity.onCreate(SdsdActivity.java:66)
02-24 18:08:12.262: E/AndroidRuntime(626): at android.app.Activity.performCreate(Activity.java:4465)
02-24 18:08:12.262: E/AndroidRuntime(626): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
02-24 18:08:12.262: E/AndroidRuntime(626): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
02-24 18:08:12.262: E/AndroidRuntime(626): ... 11 more
Maybe I am to stupid but since 3 days I trying to get it running, The Applications starts, but stops after start everytime ...
Permission Internet is done and Firewall is np > WebBrowser in emulator works as well, what is wrong? pls - thank you very much for every answer!
You are executing the run() method of your Thread object on the main thread. Replace this:
trd.run();
with this:
trd.start();
As of Android 3.0, you cannot perform this type of request on the main thread.
NetworkOnMainThreadException
Class Overview
The exception that is thrown when an application attempts to perform a networking operation on its main thread.
This is only thrown for applications targeting the Honeycomb SDK or higher. Applications targeting earlier SDK versions are allowed to do networking on their main event loop threads, but it's heavily discouraged. See the document Designing for Responsiveness.
Also see StrictMode.
See http://developer.android.com/guide/practices/design/responsiveness.html for guidelines on building responsive applications.
From your log, it looks like the error is android.os.NetworkOnMainThreadException. From http://developer.android.com/reference/android/os/NetworkOnMainThreadException.html, it sounds like the error is that you're trying to do network operations in your main thread. Since this can make your UI unresponsive, it's discouraged. And since you seem to be running in strict mode (http://developer.android.com/reference/android/os/StrictMode.html), it's crashing the app.
Also, you should be calling trd.start() instead of trd.run()

AsyncTask interrupted exception in Android?

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?

Categories

Resources