Note that there are some explanatory texts on larger screens.

plurals
  1. POApplication force closing with NullPointerException in logcat
    primarykey
    data
    text
    <p>No errors in eclipse.. But whenever I start the application it FC's :( I am trying to make a app which install scripts to init.d whenever I press the button. I think the problem is the brackets cuz they troubled me ALOT! You can see that they are arranged in an unorganised manner.</p> <p><strong>MainActivity.java</strong></p> <pre><code>package com.example.kernel.version; import java.io.IOException; import java.util.concurrent.TimeoutException; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import com.stericson.RootTools.Command; import com.stericson.RootTools.RootTools; public class MainActivity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Button button= (Button) findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { RootTools.remount("/system/", "rw"); Command command = new Command(0, "su", "cp /sdcard/scripts/* /system/etc/init.d/") { @Override public void output(int id, String line) { } }; try { RootTools.getShell(true).add(command).waitForFinish(); } catch (InterruptedException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (TimeoutException e) { e.printStackTrace(); } } });}} </code></pre> <p><strong>Activity_main.xml</strong></p> <pre><code>&lt;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" &gt; &lt;Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="22dp" android:layout_marginTop="141dp" android:text="Install Scripts" /&gt; &lt;/RelativeLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload