SDL: CreateService=y will create a persistent notification, so app is never killed

This commit is contained in:
pelya
2015-10-18 03:45:16 +03:00
parent e432efac27
commit 1d61f839ff
11 changed files with 227 additions and 27 deletions

View File

@@ -89,6 +89,8 @@ import android.graphics.Rect;
import android.view.InputDevice;
import android.inputmethodservice.KeyboardView;
import android.inputmethodservice.Keyboard;
import android.app.Notification;
import android.app.PendingIntent;
public class MainActivity extends Activity
{
@@ -226,6 +228,7 @@ public class MainActivity extends Activity
(new Thread(new Callback(this))).start();
if( Globals.CreateService )
{
Log.v("SDL", "Starting dummy service - displaying notification");
Intent intent = new Intent(this, DummyService.class);
startService(intent);
}
@@ -1485,25 +1488,3 @@ abstract class SetLayerType
}
}
}
class DummyService extends Service
{
public DummyService()
{
super();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId)
{
return Service.START_STICKY;
}
@Override
public void onDestroy()
{
}
@Override
public IBinder onBind(Intent intent)
{
return null;
}
}