Try SYSTEM_ALERT_WINDOW <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
Create a service and in the service, WindowManager mWindowManager = (WindowManager)getSystemService(WINDOW_SERVICE); LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); mTopView = (ViewGroup) inflater.inflate(R.layout.top_view, null); WindowManager.LayoutParams mWmlp = new WindowManager.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); mWmlp.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH; mWmlp.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT; mWmlp.width = 300; mWmlp.height = 200; mWmlp.format = PixelFormat.TRANSPARENT; mWmlp.x = 0; mWmlp.y = 0; //will be in the center of screen mWindowManager.addView(mTopView, mWmlp); On Fri, Jul 29, 2011 at 3:44 PM, Dianne Hackborn <hack...@android.com>wrote: > What I am saying is you shouldn't use an activity, you should go modify the > SystemUI code to introduce your window there in the same way the status bar > is done. > > > On Thu, Jul 28, 2011 at 10:37 PM, trickybit <jmack...@gmail.com> wrote: > >> Is there a way for an activity to specify the type of its main window, >> in time for it to matter? >> >> Thanks >> >> On Jul 28, 12:11 pm, Dianne Hackborn <hack...@android.com> wrote: >> > I suggest looking at the SystemUI process >> > (frameworks/base/packages/SystemUI), which is responsible for showing >> the >> > status bar and extending as desired. >> > >> > First question you will need to answer is what layer your UI goes in to: >> > above everything including the lock screen, above the system bar / >> > notifications, above toasts, just above apps. It is likely you will >> need to >> > define a new private window type with its own layer (assigned in >> > PhoneWindowManager) to get it z-ordered where you want. >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > On Thu, Jul 28, 2011 at 1:32 AM, Ankit <ank82...@gmail.com> wrote: >> > > Hi , >> > > I want to keep my application ( Application A ) on the top always in >> > > Android. Application A is not a full screen application, it is a >> > > floating window or dialog theme based application. The Application A >> > > can launch other application.\ from its own UI portion also other >> > > applications can be launched from background from Home screen >> > > shortcut / Application Launcher screen. >> > > How can we do it? >> > >> > > Also the application which are in the background with Application A on >> > > top should work normally. e.g. it can Launch other activities (of it >> > > own own or some other application), dialog etc. >> > >> > > Second doubt/ requirement is - Activity Y is below Activity X, >> > > Activity X is below Activity A (of Application A) . Activity X has a >> > > close/exit button which would finish its own activity X. Now when that >> > > button is pressed the activity get closed but leaves a black screen >> > > below activity A. >> > >> > > Why does this happen (i think may be because it requires the Back >> > > stack to be rearranged) and is their a turn around way of being able >> > > to do this. >> > >> > > If any application in the background launches another activity/ >> > > application then also my application ( Application A ) should come at >> > > the top of the launched activity/application. >> > >> > > Thanks , >> > > Ankit >> > >> > > -- >> > > You received this message because you are subscribed to the Google >> > > Groups "Android Developers" group. >> > > To post to this group, send email to >> android-developers@googlegroups.com >> > > To unsubscribe from this group, send email to >> > > android-developers+unsubscr...@googlegroups.com >> > > For more options, visit this group at >> > >http://groups.google.com/group/android-developers?hl=en >> > >> > -- >> > Dianne Hackborn >> > Android framework engineer >> > hack...@android.com >> > >> > Note: please don't send private questions to me, as I don't have time to >> > provide private support, and so won't reply to such e-mails. All such >> > questions should be posted on public forums, where I and others can see >> and >> > answer them. >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > > > -- > Dianne Hackborn > Android framework engineer > hack...@android.com > > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en