0

Can I run a relative or linear layout in the foreground of the device handling by swiping gestures? I have this code for foreground services but it only has a notification as an example and I haven't found something online that uses a layout. The code is below:

Notification notification = new Notification(R.drawable.icon, getText(R.string.ticker_text),
        System.currentTimeMillis());
Intent notificationIntent = new Intent(this, ExampleActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
notification.setLatestEventInfo(this, getText(R.string.notification_title),
        getText(R.string.notification_message), pendingIntent);
startForeground(ONGOING_NOTIFICATION_ID, notification);
leonardo
  • 93
  • 2
  • 10
  • Depending on what you need, here's a question dealing with how Facebook implemented chat heads. http://stackoverflow.com/questions/15975988/what-apis-in-android-is-facebook-using-to-create-chat-heads – DeeV Aug 21 '15 at 22:12

1 Answers1

1

All you have to do is just create Activity with transparent window. A good example is given here: How do I create a transparent Activity on Android?

So when it starts it appears above every application and you can implement every layout you want.

Community
  • 1
  • 1
Kirill Popov
  • 310
  • 1
  • 2
  • 11