Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
6ba0b029
Commit
6ba0b029
authored
Jul 30, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
Main.java
android/src/Main.java
+18
-5
No files found.
android/src/Main.java
View file @
6ba0b029
...
...
@@ -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
);
t
v
.
setText
(
"Music Player Daemon is running"
+
"\nCAUTION: this version is EXPERIMENTAL!"
);
setContentView
(
t
v
);
textView
=
new
TextView
(
this
);
t
extView
.
setText
(
"Music Player Daemon is running"
+
"\nCAUTION: this version is EXPERIMENTAL!"
);
setContentView
(
t
extView
);
}
@Override
public
void
run
()
{
Bridge
.
run
(
this
);
quitHandler
.
sendMessage
(
quitHandler
.
obtainMessage
());
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment