forked from len0rd/rockbox
Android: Display a "Loading, please wait" dialog while we wait for the rockbox service to start
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28369 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
63da8c6875
commit
db2a8ffd30
2 changed files with 68 additions and 64 deletions
|
@ -31,6 +31,7 @@ import android.view.WindowManager;
|
|||
|
||||
public class RockboxActivity extends Activity
|
||||
{
|
||||
private ProgressDialog loadingdialog;
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
|
|
|
@ -38,6 +38,7 @@ import java.util.zip.ZipFile;
|
|||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.ProgressDialog;
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
|
@ -82,13 +83,14 @@ public class RockboxService extends Service
|
|||
/* Running on an older platform: fall back to old API */
|
||||
mStartForeground = mStopForeground = null;
|
||||
}
|
||||
startservice();
|
||||
instance = this;
|
||||
startservice();
|
||||
}
|
||||
|
||||
private void do_start(Intent intent)
|
||||
{
|
||||
LOG("Start Service");
|
||||
|
||||
/* Display a notification about us starting.
|
||||
* We put an icon in the status bar. */
|
||||
create_notification();
|
||||
|
@ -116,8 +118,12 @@ public class RockboxService extends Service
|
|||
|
||||
private void startservice()
|
||||
{
|
||||
fb = new RockboxFramebuffer(this);
|
||||
final int BUFFER = 8*1024;
|
||||
final Context me = this;
|
||||
Thread rb = new Thread(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
/* the following block unzips libmisc.so, which contains the files
|
||||
* we ship, such as themes. It's needed to put it into a .so file
|
||||
* because there's no other way to ship files and have access
|
||||
|
@ -180,10 +186,7 @@ public class RockboxService extends Service
|
|||
|
||||
System.loadLibrary("rockbox");
|
||||
|
||||
Thread rb = new Thread(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
fb = new RockboxFramebuffer(me);
|
||||
main();
|
||||
}
|
||||
},"Rockbox thread");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue