Android Wear: Custom notification layout cleared before transition - android

I'm using a custom notification layout on Android Wear by setting
WearableExtender.setDisplayIntent()
When the user taps this layout, I break out into a full screen activity on the Wearable. The custom activity embedded in the notification stops and clears before the new fullscreen activity is shown with a slide in transition. This leaves an ugly black box inside the notification container that used to be filled with the embedded activity. The same thing happens when swiping to close the full screen activity - the crossfade transition shows the empty notification container during the transition, and only restarts its embedded activity afterwards.
Is there any way to prevent this from happening? I can start the fullscreen activity with the FLAG_ACTIVITY_NO_ANIMATION flag, but that doesn't solve the issue when swiping to dismiss it, and ideally I'd like to keep the transitions.
I tried setting the theme for the fullscreen activity to translucent, hoping it would only pause the previous activity instead of stopping it, but it was still stopped and cleared.

Related

Activity with Theme.Dialog can be dismissed when user touches anywhere on screen, but not with Theme.panel

I'm trying to display an activity with a button that covers a portion of the screen similar to a dialog.
This was almost working as I wanted it by using #android:style/android:Theme.Holo.Panel. It wasn't quite what I wanted however as I want the background to be dimmed with the activity is displayed. So I switched to this style instead: #android:style/android:Theme.Holo.Dialog.NoActionBar.
Now this looks like I want it and the background is dimmed. BUT the problem with this is if the user touches anywhere on the screen apart from the dialog then the activity gets dismissed. This does't happen with the Panel theme, the user can only dismiss it by pressing on the button.
How can I prevent the activity from being dismissed on any touch event with the Theme.Holo.Dialog?
Have you tried this.setFinishOnTouchOutside(false); ?
This being your activity.

Does creating a system alert window using a service send top activity onPause

I am debugging some code where A service adds a system alert window on top of an activity as a result of a key event.
The window has input fields, for which the keyboard gets displayed which clears the fullscreen flags which the top activity had set when it was created.
This can only happen if the top activity wasn't sent to the background when the service added the system_alert_window on top of the activity.
Thus i wanted to confirm whether, an activity goes to background or onPause() when a system_alert_window is added on top of it, like would happen if an another activity starts on top of it.
I did more research as part of an ongoing bug to modify AOSP.
In the process, i learnt that
No opening an alert window on top of an activity shouldn't and doesn't send it to background or call onPause().
The activity window is no more in focus, when an alert window gets opened on top of it, but the activity view is still visible, ie. view.visibility =VISIBLE.
When the overlay window is exited, the activity window again gains focus.

Get access of launcher screen while showing activity content?

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.

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