Get access of launcher screen while showing activity content? - android

is it possible to get touch access of launcher while showing activity?
while activity covering only quarter of screen area only.

as i said make an activity layout which cover quarter area of screen, I added flag for activity getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE, PixelFormat.TRANSLUCENT);
it works :) to get access of launcher screen, even my activity is open. I notice another one thing i m not able to get click event on launcher, nor getting focus from my activity to launcher, it's just giving me touch event on launcher.
any one have idea over this, how can i get focus from my activity to launcher or any open application.

Related

Delegate event from my activity to screen

I have a activity themed like a dialog and I have it setup so that it finishes when the user click outside.
this.setFinishOnTouchOutside(true);
As expected when the user clicks outside, it finishes. The activity is marked as floating activity and is only shown on top of the phone.
Now, if the user click on any other part of screen like the phone button/contact button on home screen, then the activity gets finished, but the user has to click on phone/contact app icon again to open phone/conatct app.
What I want is that if user click outside my activity, then the action must be performed as if the activity is not at all present on screen. Something like notification, which does not prevent user from doing other other tasks.
The only way you might be able to do this is by using a hidden WindowManager.LayoutParams flag, FLAG_SLIPPERY.
This allows touches starting on your View to continue to whatever View is below when the touch leaves your View but remains on the screen. However, I don't think this will work.
Android prevents you from touching "through" a touchable Window because it assumes that Window should be receiving the TouchEvent. Android also prevents you from programmatically "touching" the screen (without root or system access), most likely for security reasons.
I dug through AOSP for a while and found this.
Reading the comments, it's possible to infer that, while what you see doesn't take up the whole screen, the Activity's Window does. So, while nothing in your Activity is clicked, the Window is still overlaying everything, just with a transparent background, and is dealing with the touches that aren't passed to your Activity's UI. This brings us back to the "touching through" issue.

How to bypass the lockscreen in android.?

I'm working on a lockscreen widget(not trying to be specific here, but Nexus 7 ) . The widget has a button which would trigger an activity.When the user clicks the button, the unlock slide symbol get's highlighted hinting the user has to slide-unlock his screen before he wants to see the button's activity. Since now, the device is locked,is there a way to bypass this and just display the activity on top of the lock screen? (not in the case of pin/pattern obviously, but only just slide)
Was searching a lot for a way to do it. We need to use flags in while giving an intent to the widget button. More information here.
Android Lock Screen Widget

Changing Activity screen when the app is not running

How can i change the screen of an activity when pressing any button on an android phone that takes one away from the running app.
I'm trying to get a blank screen to show up on the "recents" screen, instead of a snapshot of the app.
You can use this option and check if it helps you meet your need.
android:excludeFromRecents="true"
Add this to your activities in the application manifest if you do not want the app to be shown in the recent apps list. One drawback is that you would not be able to resume the app from the Recents list. Not sure if this is what you need.
The other way is to have a 'Blank Activity', which you start when your actual activity pauses. You can then finish the 'Blank Activity' on its Resume. This way, you will have your app shown on the Recents list, but with a blank screen.
You can call finish() for activity but that will kill activity. I think that will leave blank screen. Or destroy(). Try both respond with results.
you might want to change the onpause() or onclose() functions of your app. they are the last thing android execute before leaving,therefor you can change the aspect off your app just before you leave it
EDIT :
Maybe if you create PopupWindow and set it to full screen, and color black when exiting no preview would be shown, but app would still be running (idea of user DjDexter5GH) in the onpause() and onclose() functions. therefgor,when you leave,a black(or whatever you want) screen is pushed in front
you can then close it in the onrestart(is it called this?)

Android activity with FLAG_NOT_TOUCH_MODAL flag on top of home screen

I am having an android activity with FLAG_NOT_TOUCH_MODALset.
My activity is translucent and not full screen.
I just want to by-pass the touch events outside my activity window boundary to the underlying activity.
I am able to by-pass the event successfully so that i can scroll the underlying activity when my activity is on top of it.
My problem is, When my activity is on top of the "Applications List" Screen, i am not able to launch any application from the list. But I can scroll the list and the icon of the selected application is getting highlighted when selected. But it is not getting launched.
But when my activity with FLAG_NOT_TOUCH_MODAL is on top of the home screen (where we see wallpaper) the applications can be launched when user clicks on the shortcut icons
Please help me with this issue.
Thanks in advance.
Pragadeesh

How to bring an activity to the foreground from inside the activity?

I am trying to bring an activity to the foreground from inside the activity. I am implementing multiple applications that do not cover the whole screen, so you can see other applications (activities) in the background and even touch them. The activities in the background react to the on touch event (e.g. one of its buttons is pressed), but it is not getting focus. This is what I would like to change. I want the activity to get focus and come to the foreground, whenever it is touched.
I tried to call startActivity from inside, but this resulted in either starting a new activity or no reaction at all (depending on the used intent flags). I want to achieve the exact same behavior that is shown when the activity is called from recent activities window. (the window opened when you long press the home button); bring the existing activity from the background to the foreground and focus it.
Is there a way to achieve this?
Have you tried configuring the activity in the manifest as android:launchMode="singleTop"?
This way, when you launch your activity when it is already running, a duplicate won't be started.
More info here:
https://developer.android.com/guide/topics/manifest/activity-element.html

Categories

Resources