save the static pointer to the main Activity in SimpleSSHD because it'll

be used by more than just SimpleSSHDService..
sigsegv_dump
Greg Alexander 10 years ago
parent 1642eec8fd
commit 932bfa3242

@ -16,9 +16,9 @@ import android.net.Uri;
public class SimpleSSHD extends Activity
{
private Button startstop_view;
public static SimpleSSHD curr = null;
public void onCreate(Bundle savedInstanceState)
{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Prefs.init(this);
setContentView(R.layout.main);
@ -28,11 +28,11 @@ public class SimpleSSHD extends Activity
public void onResume() {
super.onResume();
update_startstop();
SimpleSSHDService.activity = this;
curr = this;
}
public void onPause() {
SimpleSSHDService.activity = null;
curr = null;
super.onPause();
}

@ -10,7 +10,6 @@ import java.io.FileReader;
public class SimpleSSHDService extends Service {
public static int sshd_pid = 0;
public static SimpleSSHD activity = null;
public void onCreate() {
super.onCreate();
@ -84,10 +83,10 @@ public class SimpleSSHDService extends Service {
}
private static void update_activity() {
if (activity != null) {
activity.runOnUiThread(new Runnable() {
if (SimpleSSHD.curr != null) {
SimpleSSHD.curr.runOnUiThread(new Runnable() {
public void run() {
activity.update_startstop();
SimpleSSHD.curr.update_startstop();
}
});
}

Loading…
Cancel
Save