Commit 6ba0b029 authored by Max Kellermann's avatar Max Kellermann

android/Main: indicate when the native code has quit

Let the user know that MPD has failed. Not the best thing to do, but better than pretending it still runs.
parent 604c9dac
......@@ -21,8 +21,10 @@ package org.musicpd;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.widget.TextView;
import android.util.Log;
public class Main extends Activity implements Runnable {
......@@ -30,6 +32,16 @@ public class Main extends Activity implements Runnable {
Thread thread;
TextView textView;
final Handler quitHandler = new Handler() {
public void handleMessage(Message msg) {
textView.setText("Music Player Daemon has quit");
// TODO: what now? restart?
}
};
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -50,13 +62,14 @@ public class Main extends Activity implements Runnable {
thread.start();
}
TextView tv = new TextView(this);
tv.setText("Music Player Daemon is running"
+ "\nCAUTION: this version is EXPERIMENTAL!");
setContentView(tv);
textView = new TextView(this);
textView.setText("Music Player Daemon is running"
+ "\nCAUTION: this version is EXPERIMENTAL!");
setContentView(textView);
}
@Override public void run() {
Bridge.run(this);
quitHandler.sendMessage(quitHandler.obtainMessage());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment