Continuous Community Learning
I am facing this error..your application XXX has stopped unexpectedly.please try again...My application was working all fine but suddenly I started getting this error..I read online about the adb logcat..but I could not make out where the error is...
Secondly..I was trying to add a button but when i click it the code does not get executed...
Have i gone wrong while coding because it does show any errors...
AsyncHttp.java(my project name)
Button buttonSend = (Button)findViewById(R.id.send);
buttonSend.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click
//text.setText("in click listener");
Handler handler = new Handler() {};
new HttpConnection(handler)
.get("http://10.0.0.2:8090/UriExample/rest/hello/abc");
}
});
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/send"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Send"
/>
<ImageView android:id="@+id/icon" android:layout_width="wrap_content"
android:layout_height="wrap_content"></ImageView>
<ScrollView android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/text" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:textColor="#FFFFFF" />
<TextView android:id="@+id/text1" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:textColor="#FFFFFF" />
</ScrollView>
</LinearLayout>
It may be a very silly question but help will be appreciated....I have attached the screenshot of the first error...
Thanking You,
Nazneen
Tags: Android
Hi Nazneen,
Could you please send me the logcat's snapshot too?
Maybe there's some permission that needs to be added.
Thanks and Regards,
Nikhil
Permalink Reply by Shrenik Vikam on September 13, 2011 at 11:29am it requires Internet permission when you want to connect to any network part.
Permalink Reply by Nazneen Rupawalla on September 13, 2011 at 7:01pm in the sense..?? in androidManifest.xml??
Permalink Reply by Shrenik Vikam on September 13, 2011 at 7:41pm
Permalink Reply by Nazneen Rupawalla on September 13, 2011 at 9:21pm Sir,
The permission I have added in AndroidManifest.xml...I had written it...But the error went..and I have no idea how..I just started the program all over again and the error went...But as you said the handler is wrong...I had tried this code before referring the documentation...bt it did not work so went ahead tryn this change..original code was..
Handler handler = new Handler();
new HttpConnection(handler).get("http://10.0.0.2:8090/UriExample/rest/hello/abc");
Is this wrong too???
sry to bother yall..but im getting stuck with these small errors...
Permalink Reply by Shrenik Vikam on September 14, 2011 at 1:13am I will suggest to go through following link first
http://developer.android.com/reference/android/os/Handler.html
http://saigeethamn.blogspot.com/2010/04/threads-and-handlers-androi...
Is that your first android program ?
Permalink Reply by Nazneen Rupawalla on September 14, 2011 at 11:18am
Permalink Reply by Nazneen Rupawalla on September 14, 2011 at 12:10pm
Permalink Reply by Suraj Krishnaswami on October 11, 2011 at 2:34am © 2012 Created by Kaushik.