surfaceview

SurfaceView with camera preview is not destroyed

风格不统一 提交于 2020-01-01 10:48:12
问题 I have a Tab Activity with 2 tabs (activities). Each tab has a 3d Open GL scene drawn on top of a SurfaceView with camera preview. Yet, depending on device orientation, tabs are being switched. The problem is that when the other activity starts, it calls camera.open(), which generates exception, saying that camera service is unavailable. In fact, the problem is that camera is not stopped when activity is paused, in other words onSurfaceDestroyed() is not called for the SurfaceView. I tried to

Android Surfaceview Threads and memory leaks

扶醉桌前 提交于 2019-12-31 14:45:57
问题 Im creating a game in android, and i noticed that the game has a memory leak. Iv managed to isolate the memory leak into a smaller application so that i can see well try and work out, how to fix it. The application uses a surfaceview for its view and has a thread attached to that in order to do all the drawing to the screen. The memory leak happens when i start a new activity and close the one that im currently using. I can see this when i do a memory dump on my test application as all it

surfaceview + glsurfaceview + framelayout

让人想犯罪 __ 提交于 2019-12-31 14:32:33
问题 I'm new at java and OpenGL. I'm trying to get a camera preview screen with the ability to display 3d objects simultaneously. Having gone through the samples at the api demos, I thought combining the code for the the examples at the api demo would suffice. But somehow its not working. The forces me to shut down upon startup and the error is mentioned as null pointer exception. Could someone share with me where did I go wrong and how to proceed from there. How I did the combination for the code

Streaming CustomView ARcore with Twilio video

☆樱花仙子☆ 提交于 2019-12-31 01:51:10
问题 I've a problem when i want to streaming a custom view with twilio video api along with ARcore, basically it stream a black screen. I used ViewCapturer class from example to this link https://github.com/twilio/video-quickstart-android/tree/master/exampleCustomVideoCapturer from the official documentation, but doen't work with arcore, probably due to the presence of the surface view in the arFragment. Thank you for your support. activity_camera.xml <?xml version="1.0" encoding="utf-8"?>

DrawerLayout not working with Android 4.4 & SurfaceView

蹲街弑〆低调 提交于 2019-12-30 10:34:50
问题 Today I had one of those "android" moments again, which left me absolutely clueless. I have an app which consists of a DrawerLayout, which includes a RelativeLayout as container for a SurfaceView (surfaceViewContainer) and a second ViewGroup (subclass of RelativeLayout) as navigation. When the app starts, in onCreate I inflate the layout and add a SurfaceView to the surfaceViewContainer. On a Samsung S2 with 4.1.2 and a S3 with 4.3 everything works fine, I can see the SurfaceView drawn and I

How can I make a SurfaceView larger than the screen?

随声附和 提交于 2019-12-30 04:01:08
问题 I would like to effectively make a simple digital zoom for the camera preview, so I thought I would simply resize my SurfaceView to be larger than the screen. Other questions (such as 3813049) seem to indicate that this is easy, so I created the sample code below which I expect to let me see only half of the image horizontally (since the SurfaceView is twice as wide as the screen) and have the image only take up half of the screen horizontally. However, running it (when targeted to SDK

Canvas and surfaceView example crash/freeze - Memory Leak?

此生再无相见时 提交于 2019-12-29 09:32:40
问题 http://www.helloandroid.com/tutorials/how-use-canvas-your-android-apps-part-1 At the end of this tutorial link for source code download is available. I downloaded the code and tried this example , It draws a kangaroo in the screen and within 1-2 minutes i get a crash/the application froze. I tried on Archos 70 Internet Tablet. "I would like to know the reason, or if some thing is wrong in this " Here is the LogCat 04-13 17:03:24.089: DEBUG/ondraw(2070): lefutott 04-13 17:03:24.097: DEBUG

ugly fragment transition to surfaceview with overlay

狂风中的少年 提交于 2019-12-29 08:56:31
问题 My app one of the fragments draws a map in a surface view with an overlay for buttons and text. Most of the other fragments are lists. My problem is that during the transition between the map and another fragment, ugly black rectangles momentarily appear in the map view where the text and button views are placed. This appears more pronounced on a transition back to the map, although it does happen in both directions. I am using a slide-left/slide-right animation which works nicely in all

Setting image background in SurfaceView, getting black screen

风格不统一 提交于 2019-12-29 07:19:07
问题 Okay so Im trying to set the background of a SurfaceView to a JPG file. But it doesn't seem to want to draw the image, and all I get is a black screen. Here:s my code: public class FloorplanActivity extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MapView mapView = new MapView(getApplicationContext()); setContentView(mapView); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to

Invisible SurfaceView for Camera Preview

允我心安 提交于 2019-12-29 06:54:16
问题 I need to get camera preview data only, but not visible preview. Since I'm doing all this in a service, I had to create a dummy SurfaceView, which works very well. I've used the code from this answer: https://stackoverflow.com/a/10268650/1395697 However, with TYPE_SYSTEM_OVERLAY it didn't work. It was invisible but no preview data was received (in onPreviewFrame() ). When I change this argument to 0, I get preview data, but the SurfaceView is visible. Do you know any other way to do this?