Home > Mobile >  [for] how Android in SurfaceView subclass update Camera preview interface text display
[for] how Android in SurfaceView subclass update Camera preview interface text display

Time:04-15

I'm in the development of camera real-time scanning and identify the function of the text, you need to identify the result of the real-time display in the preview screen,

Achieve preview class is CameraView of scanning and recognition of the class inherits the SurfaceView, could you tell me in CameraView character recognition results on how the String displayed in the interface? (by the question that has baffled many days)

At present in a subclass of SurfaceView CameraView, I tried the TextView and XML layout file id is the result of TextView component bindings

ResultText=(TextView) the findViewById (R.i d.r esult);

Below is TextView needs to be associated with XML files


But it can't find this component, the implementation of the above line of code after resultText is still null


Through access to information, may need to have a View to load the XML file, you need to use the View. The findViewById (), but don't know how to use the LayoutInflater need to bind an XML file, in the figure below breakpoint debugging, the running cycle, but also does not have an error,


Do you have a great god can help me with?
Why in the class of the Activity can be the findViewById but I can't find it in the SurfaceView subclass?
How to use the LayoutInflater load XML file which I need binding TextView?
Or, there are other ways to the camera preview SurfaceView class, real-time text will update in the preview screen?
Many days, request, thank you very much!!!!!
  • Related