Android app crashes when initializing AndroidAsyncHttp - java

As I understood (from here) the LoopJ AndroidAsyncHttp does not uses the UI Thread, therefore i can execute its methods in the Main Thread.
but when i intilize a new instance of AsyncHttpClient the app crashes
(exception: java.lang.IllegalStateException: Could not execute method of the activity )
code :
public class MainActivity extends ActionBarActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void Send(View view) {
EditText editText = (EditText) findViewById(R.id.editText1);
String str = editText.getText().toString();
TextView div = (TextView) findViewById(R.id.textView1);
div.setText(str);
//crash
AsyncHttpClient client = new AsyncHttpClient();
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
Error:
09-25 09:58:07.427: W/dalvikvm(2514): threadid=1: thread exiting with uncaught exception (group=0xb1cb2b20)
09-25 09:58:07.477: E/AndroidRuntime(2514): FATAL EXCEPTION: main
09-25 09:58:07.477: E/AndroidRuntime(2514): Process: com.example.mysecondapp, PID: 2514
09-25 09:58:07.477: E/AndroidRuntime(2514): java.lang.IllegalStateException: Could not execute method of the activity
09-25 09:58:07.477: E/AndroidRuntime(2514): at android.view.View$1.onClick(View.java:3823)
09-25 09:58:07.477: E/AndroidRuntime(2514): at android.view.View.performClick(View.java:4438)
09-25 09:58:07.477: E/AndroidRuntime(2514): at android.view.View$PerformClick.run(View.java:18422)
09-25 09:58:07.477: E/AndroidRuntime(2514): at android.os.Handler.handleCallback(Handler.java:733)
09-25 09:58:07.477: E/AndroidRuntime(2514): at android.os.Handler.dispatchMessage(Handler.java:95)
09-25 09:58:07.477: E/AndroidRuntime(2514): at android.os.Looper.loop(Looper.java:136)
09-25 09:58:07.477: E/AndroidRuntime(2514): at android.app.ActivityThread.main(ActivityThread.java:5017)
09-25 09:58:07.477: E/AndroidRuntime(2514): at java.lang.reflect.Method.invokeNative(Native Method)
09-25 09:58:07.477: E/AndroidRuntime(2514): at java.lang.reflect.Method.invoke(Method.java:515)
09-25 09:58:07.477: E/AndroidRuntime(2514): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
09-25 09:58:07.477: E/AndroidRuntime(2514): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
09-25 09:58:07.477: E/AndroidRuntime(2514): at dalvik.system.NativeStart.main(Native Method)
09-25 09:58:07.477: E/AndroidRuntime(2514): Caused by: java.lang.reflect.InvocationTargetException
09-25 09:58:07.477: E/AndroidRuntime(2514): at java.lang.reflect.Method.invokeNative(Native Method)
09-25 09:58:07.477: E/AndroidRuntime(2514): at java.lang.reflect.Method.invoke(Method.java:515)
09-25 09:58:07.477: E/AndroidRuntime(2514): at android.view.View$1.onClick(View.java:3818)
09-25 09:58:07.477: E/AndroidRuntime(2514): ... 11 more
09-25 09:58:07.477: E/AndroidRuntime(2514): Caused by: java.lang.NoClassDefFoundError: com.loopj.android.http.AsyncHttpClient
09-25 09:58:07.477: E/AndroidRuntime(2514): at com.example.mysecondapp.MainActivity.Send(MainActivity.java:46)
09-25 09:58:07.477: E/AndroidRuntime(2514): ... 14 more

You're getting a NoClassDefFoundError for com.loopj.android.http.AsyncHttpClient
If you are running from an IDE, make sure to add exported="true" to the classpathentry for android-async-http-1.4.6.jar in your .classpath file.

I had to move the jar file to the "libs" folder and then add the jar to the project... thanks everyone!

Related

Passing Integer Values Between Activities - Android

Other stuck posts unfortunately couldn't help me.
When I clicked button while easy radiobutton is checked, the app stops working. I couldn't go and see another activity.
Sender Side:
btn.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
if(radiobutton_arm_triceps_easy.isChecked()) {
String dene = "my example test";
int myValue=2;
Intent intent = new Intent(getApplicationContext(), exercise_arm_triceps_execute.class);
intent.putExtra("attempt1", myValue );
startActivity(intent);
}
}
});
Receiver Side:
int receiveValue=getIntent().getIntExtra("attempt1",0);
textshow.setText(receiveValue);
LOGCAT
04-26 16:52:06.320 31527-31527/com.example.kerem.tutorial_project E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.kerem.tutorial_project, PID: 31527
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.kerem.tutorial_project/com.example.kerem.tutorial_project.exercise_arm_triceps_execute}: android.content.res.Resources$NotFoundException: String resource ID #0x2
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x2
at android.content.res.Resources.getText(Resources.java:244)
at android.support.v7.widget.ResourcesWrapper.getText(ResourcesWrapper.java:52)
at android.widget.TextView.setText(TextView.java:3888)
at com.example.kerem.tutorial_project.exercise_arm_triceps_execute.onCreate(exercise_arm_triceps_execute.java:28)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Use
textshow.setText(String.valueOf(receiveValue));

Fragment cannot be cast to android.content.Context

I want to connect my login page to MySQL PHP but I got some error here.
This is my logcat:
807/com.aeu.mlibrary.mlibraryaeu E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.aeu.mlibrary.mlibraryaeu, PID: 1807
java.lang.ClassCastException: com.aeu.mlibrary.mlibraryaeu.LoginFragment cannot be cast to android.content.Context
at com.kosalgeek.asynctask.PostResponseAsyncTask.<init>(PostResponseAsyncTask.java:284)
at com.aeu.mlibrary.mlibraryaeu.LoginFragment.onClick(LoginFragment.java:82)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
and this is the error line in my loginFragment.java:
#Override
public void onClick(View v) {
HashMap postData = new HashMap();
postData.put("mobile", "android");
postData.put("txtUsername", etUsername.getText().toString());
postData.put("txtPassword", etPassword.getText().toString());
PostResponseAsyncTask task = new PostResponseAsyncTask(LoginFragment.this, postData);
task.execute("http://10.0.3.2/mlibrary/HTML/login.php");
}
I need your help guys!
Thank you.
Replace LoginFragment.this with getActvity()
PostResponseAsyncTask task = new PostResponseAsyncTask(getActivity(), postData);
Replace LoginFragment.this with getContext() :
PostResponseAsyncTask task = new PostResponseAsyncTask(getContext(), postData);

ProgressBar inside of Fragment class causing NullPointerException at setMax method?

#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.analogin_fragment,
container, false);
AITVVOLT0 = (TextView) rootView.findViewById(R.id.aintvvolt0);
AITVVOLT1 = (TextView) rootView.findViewById(R.id.aintvvolt1);
AITVVOLT2 = (TextView) rootView.findViewById(R.id.aintvvolt2);
AITVVOLT3 = (TextView) rootView.findViewById(R.id.aintvvolt3);
AITVVOLT4 = (TextView) rootView.findViewById(R.id.aintvvolt4);
AITVVOLT5 = (TextView) rootView.findViewById(R.id.aintvvolt5);
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar0);
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar1);
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar2);
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar3);
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar4);
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar5);
AIVOLTBAR0.setMax(100);
AIVOLTBAR1.setMax(100);
AIVOLTBAR2.setMax(100);
AIVOLTBAR3.setMax(100);
AIVOLTBAR4.setMax(100);
AIVOLTBAR5.setMax(100);
AIVOLTBAR0.setProgress(0);
AIVOLTBAR1.setProgress(0);
AIVOLTBAR2.setProgress(0);
AIVOLTBAR3.setProgress(0);
AIVOLTBAR4.setProgress(0);
AIVOLTBAR5.setProgress(0);
return rootView;
}
The AIVOLTBAR#.setMax(); methods are causing a NullPointerException - but the ProgressBars are not null (Tested with a log as well as commenting out the setMax causes the program to work).
Logcat:
08-20 16:23:18.409: E/AndroidRuntime(1332): Process: com.nanospark.androidapp, PID: 1332
08-20 16:23:18.409: E/AndroidRuntime(1332): java.lang.NullPointerException
08-20 16:23:18.409: E/AndroidRuntime(1332): at com.nanospark.androidapp.MainActivity$AnalogInputFragment.onCreateView(MainActivity.java:218)
08-20 16:23:18.409: E/AndroidRuntime(1332): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
08-20 16:23:18.409: E/AndroidRuntime(1332): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:938)
08-20 16:23:18.409: E/AndroidRuntime(1332): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1115)
08-20 16:23:18.409: E/AndroidRuntime(1332): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
08-20 16:23:18.409: E/AndroidRuntime(1332): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1478)
08-20 16:23:18.409: E/AndroidRuntime(1332): at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:446)
08-20 16:23:18.409: E/AndroidRuntime(1332): at android.os.Handler.handleCallback(Handler.java:733)
08-20 16:23:18.409: E/AndroidRuntime(1332): at android.os.Handler.dispatchMessage(Handler.java:95)
08-20 16:23:18.409: E/AndroidRuntime(1332): at android.os.Looper.loop(Looper.java:136)
08-20 16:23:18.409: E/AndroidRuntime(1332): at android.app.ActivityThread.main(ActivityThread.java:5017)
08-20 16:23:18.409: E/AndroidRuntime(1332): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 16:23:18.409: E/AndroidRuntime(1332): at java.lang.reflect.Method.invoke(Method.java:515)
08-20 16:23:18.409: E/AndroidRuntime(1332): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
08-20 16:23:18.409: E/AndroidRuntime(1332): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
08-20 16:23:18.409: E/AndroidRuntime(1332): at dalvik.system.NativeStart.main(Native Method)
08-20 16:27:27.557: E/BluetoothAdapter(1387): Bluetooth binder is null
08-20 16:27:27.853: E/OpenGLRenderer(1387): Getting MAX_TEXTURE_SIZE from GradienCache
08-20 16:27:27.853: E/OpenGLRenderer(1387): MAX_TEXTURE_SIZE: 16384
08-20 16:27:27.865: E/OpenGLRenderer(1387): Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
08-20 16:27:27.869: E/OpenGLRenderer(1387): MAX_TEXTURE_SIZE: 16384
08-20 16:27:28.409: E/AndroidRuntime(1387): FATAL EXCEPTION: main
08-20 16:27:28.409: E/AndroidRuntime(1387): Process: com.nanospark.androidapp, PID: 1387
08-20 16:27:28.409: E/AndroidRuntime(1387): java.lang.NullPointerException
08-20 16:27:28.409: E/AndroidRuntime(1387): at com.nanospark.androidapp.MainActivity$AnalogInputFragment.onCreateView(MainActivity.java:223)
08-20 16:27:28.409: E/AndroidRuntime(1387): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
08-20 16:27:28.409: E/AndroidRuntime(1387): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:938)
08-20 16:27:28.409: E/AndroidRuntime(1387): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1115)
08-20 16:27:28.409: E/AndroidRuntime(1387): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
08-20 16:27:28.409: E/AndroidRuntime(1387): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1478)
08-20 16:27:28.409: E/AndroidRuntime(1387): at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:446)
08-20 16:27:28.409: E/AndroidRuntime(1387): at android.os.Handler.handleCallback(Handler.java:733)
08-20 16:27:28.409: E/AndroidRuntime(1387): at android.os.Handler.dispatchMessage(Handler.java:95)
08-20 16:27:28.409: E/AndroidRuntime(1387): at android.os.Looper.loop(Looper.java:136)
08-20 16:27:28.409: E/AndroidRuntime(1387): at android.app.ActivityThread.main(ActivityThread.java:5017)
08-20 16:27:28.409: E/AndroidRuntime(1387): at java.lang.reflect.Method.invokeNative(Native Method)
08-20 16:27:28.409: E/AndroidRuntime(1387): at java.lang.reflect.Method.invoke(Method.java:515)
08-20 16:27:28.409: E/AndroidRuntime(1387): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
08-20 16:27:28.409: E/AndroidRuntime(1387): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
08-20 16:27:28.409: E/AndroidRuntime(1387): at dalvik.system.NativeStart.main(Native Method)
The problem is that you have some typos. You're setting AIVOLTBAR0 multiple times instead of setting each progress bar individually:
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar0);
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar1);
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar2);
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar3);
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar4);
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar5);
Instead it needs to be this:
AIVOLTBAR0 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar0);
AIVOLTBAR1 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar1);
AIVOLTBAR2 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar2);
AIVOLTBAR3 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar3);
AIVOLTBAR4 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar4);
AIVOLTBAR5 = (ProgressBar) rootView.findViewById(R.id.aintvvoltbar5);

string to integer conversion in android

I have a problem in String conversion here i pass a value through intent and access through bundle and now i want to convert into integer but it is showing force stopped ..........
MainActivity code:
btn.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
// TODO Auto-generated method stub
Intent in=new Intent(MainActivity.this,second.class);
in.putExtra("id", "12");
startActivity(in);
}
});
secondActivity code:
Bundle extras = getIntent().getExtras();
id=extras.getString("id");
btn=(Button)findViewById(R.id.button1);
tv=(TextView)findViewById(R.id.value);
btn.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
// TODO Auto-generated method stub
int myid=Integer.parseInt(id);
//tv.setText(myid);
Toast.makeText(getApplicationContext(), myid,Toast.LENGTH_SHORT).show();
}
});
LogCat:>
09-25 18:21:52.045: E/AndroidRuntime(1555): FATAL EXCEPTION: main
09-25 18:21:52.045: E/AndroidRuntime(1555): android.content.res.Resources$NotFoundException: String resource ID #0xc
09-25 18:21:52.045: E/AndroidRuntime(1555): at android.content.res.Resources.getText(Resources.java:230)
09-25 18:21:52.045: E/AndroidRuntime(1555): at android.widget.Toast.makeText(Toast.java:265)
09-25 18:21:52.045: E/AndroidRuntime(1555): at com.example.convert.second$1.onClick(second.java:34)
09-25 18:21:52.045: E/AndroidRuntime(1555): at android.view.View.performClick(View.java:4204)
09-25 18:21:52.045: E/AndroidRuntime(1555): at android.view.View$PerformClick.run(View.java:17355)
09-25 18:21:52.045: E/AndroidRuntime(1555): at android.os.Handler.handleCallback(Handler.java:725)
09-25 18:21:52.045: E/AndroidRuntime(1555): at android.os.Handler.dispatchMessage(Handler.java:92)
09-25 18:21:52.045: E/AndroidRuntime(1555): at android.os.Looper.loop(Looper.java:137)
09-25 18:21:52.045: E/AndroidRuntime(1555): at android.app.ActivityThread.main(ActivityThread.java:5041)
09-25 18:21:52.045: E/AndroidRuntime(1555): at java.lang.reflect.Method.invokeNative(Native Method)
09-25 18:21:52.045: E/AndroidRuntime(1555): at java.lang.reflect.Method.invoke(Method.java:511)
09-25 18:21:52.045: E/AndroidRuntime(1555): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
09-25 18:21:52.045: E/AndroidRuntime(1555): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
09-25 18:21:52.045: E/AndroidRuntime(1555): at dalvik.system.NativeStart.main(Native Method)
Don't do TextView.setText(int), do TextView.setText(String), that means skipping the conversation completely. There are multiple inputs setText() can take, as shown here.
What's happening in your case is that since you are converting your value over to an integer, you're inadvertently calling public final void setText (int resid) which assumes the integer passed into it is the R.id value of something in your strings.xml file.
That's clearly not what you want to be doing, so you can do one of two things to fix it:
Replace your setText() with setText("" + myid);
Stop converting your value to an int!

AsyncTask doesn't execute when trying to clean HTML with HtmlCleaner

I'm trying to clean HTML with HtmlCleaner using AsyncTask. This is the code:
private class cleanHtml extends AsyncTask<Void, Void, Void>{
#Override
protected Void doInBackground(Void... arg0) {
try {
HtmlCleaner cleaner = new HtmlCleaner();
String url = "https://www.easistent.com/urniki/263/razredi/16515";
TagNode node = cleaner.clean(new URL(url));
CleanerProperties props = cleaner.getProperties();
new PrettyXmlSerializer(props).writeToFile(node, "cleaned.xml", "utf-8");
Log.i("TAG", "Executing AsyncTask");
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
}
I'm executing AsyncTask in onCreate method:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
new cleanHtml().execute();
}//End of onCreate
However, nothing happens. As you can see I put log.i inside the AsyncTask to see if it is executing r not and I never see the log.i message inside logcat. What could I be doing wrong? Also, where in my phone will "cleaned.xml" appear? Since I didn't set any kind of destination folder.
Logcat (info):
09-25 20:23:31.739: W/System.err(19078): java.io.FileNotFoundException: /cleaned.xml: open failed: EROFS (Read-only file system)
09-25 20:23:31.747: W/System.err(19078): at libcore.io.IoBridge.open(IoBridge.java:409)
09-25 20:23:31.747: W/System.err(19078): at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
09-25 20:23:31.747: W/System.err(19078): at java.io.FileOutputStream.<init>(FileOutputStream.java:128)
09-25 20:23:31.755: W/System.err(19078): at java.io.FileOutputStream.<init>(FileOutputStream.java:117)
09-25 20:23:31.755: W/System.err(19078): at org.htmlcleaner.Serializer.writeToFile(Serializer.java:131)
09-25 20:23:31.755: W/System.err(19078): at org.htmlcleaner.Serializer.writeToFile(Serializer.java:142)
09-25 20:23:31.755: W/System.err(19078): at com.whizzapps.stpsurniki.ScheudeleWithDesign$cleanHtml.doInBackground(ScheudeleWithDesign.java:36)
09-25 20:23:31.755: W/System.err(19078): at com.whizzapps.stpsurniki.ScheudeleWithDesign$cleanHtml.doInBackground(ScheudeleWithDesign.java:1)
09-25 20:23:31.755: W/System.err(19078): at android.os.AsyncTask$2.call(AsyncTask.java:287)
09-25 20:23:31.755: W/System.err(19078): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
09-25 20:23:31.755: W/System.err(19078): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
09-25 20:23:31.755: W/System.err(19078): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
09-25 20:23:31.755: W/System.err(19078): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
09-25 20:23:31.755: W/System.err(19078): at java.lang.Thread.run(Thread.java:841)
09-25 20:23:31.755: W/System.err(19078): Caused by: libcore.io.ErrnoException: open failed: EROFS (Read-only file system)
09-25 20:23:31.755: W/System.err(19078): at libcore.io.Posix.open(Native Method)
09-25 20:23:31.755: W/System.err(19078): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
09-25 20:23:31.763: W/System.err(19078): at libcore.io.IoBridge.open(IoBridge.java:393)
The AsncTask is executed. But the execution is not brought to an end because of an exception.
You are getting a FileNotFoundEcxeption in this line:
new PrettyXmlSerializer(props).writeToFile(node, "cleaned.xml", "utf-8");
which is caught by your catch-block preventing your app from crashing.
The Exception could be caused by:
The path to the "cleaned.xml" file not being correct.
Typos int he filename.

Categories