I know how to use overridePendingTranition to change the animation between activities inside of my own application. My question is how can I get the same result when sending an intent to open a Youtube video for example. It will work correctly but because the Youtube application is not a translucent theme I see a black screen immediately and then the content slide in using my animation. Is there anyway to control the animation starting that activity as well as the animation that will run when the user clicks back to come back to your application?
Thanks
Related
I'm trying to add functionality to my foreground service notification to just open the app when the notification is clicked. I don't want to run any activity - I just want to display the app.
Basically I want to achieve same thing that can be achieved in Android by bringing list of apps and clicking on one).
I've checked lots of posts on StackOverflow, but all of them use activity class in Intent, while I don't care about any particular activity - I just want to bring the app up.
You must have a launcher activity right? so you always can start an activity with your launcher activity and use a launch mode in the AndroidManifest.xml to define to bring it up if it already has been created.
I am developing a simple screen lock application.
I want that when I click on the app icon the screen gets locked and turns off. And am also able to do that, BUT before locking the screen the main activity gets launched (Set to Theme.NoDisplay) which takes time to get the device locked, which I don't want to happen.
So is there a way that I can turn off my screen (OR do something like starting Torch) without launching the app activity. If required I can also provide the code which i am with.
I think what you are looking for is android widget.
I am wondering if it is possible to show the output of the camera running on your device immediately on the screen. Just like the native camera app does.
I have to show the picture, that comes into the camera lens, and additionally add some graphics overlays. That's why I guess, starting an Intent to open the camera activity is not suitable.
I've found some SO Threads, Tutorials and documentation about using the Android Camera API, but they are all able to just take a picture and display it afterwards.
Is it possible at all?
Refer to this link Camera Tutorial for Android (using surfaceview)!
Use the SurfaceView to preview the camera output, then, you can add your graphics overlays as you wish.
Hope this helps :)
I'm building an app for Android using the YouTube API. The video is in a scroll widget, and when I scroll and the video goes up or down the screen, it stops. I want the video to continue even though isn't in the screen. How can I do that?
i went through the same problem, i open this question:
Android YouTube API video pause when rotate screen or hide player
see the comments to understand better. For the tests I did, the Youtube API knows when the player is not showing on the screen and just pause the video. As a workaround I changed my layout so that the player be fixed on the screen, just as is the official app from youtube.
I use this question as reference:
Scrolling Text Above Buttons, Buttons Fixed At Bottom
So, I'm using this code to play some video after a button click:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=VYqhW2YFN7k")));
But it just opens the whole youtube web page in the browser with suggested videos and stuff. Is there a way to directly play the video in landscape mode in fullscreen?
If You are using Youtubeplayer APi to view video than you can use this line in onInitializationSuccess Method
youTubePlayer.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE);
youTubePlayer.setFullscreen(true);
Set your screen orientation landscape in android manifestfile.
You can use the new YouTube Data API by Google.
There, you have a lot of control of how to show the video. This includes even putting the view that shows the video into your activity, so you can set whatever orientation you wish for it.