Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advanced search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Devaka Cooray
Tim Cooke
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Saloon Keepers:
Piet Souris
Bartenders:
Forum:
Android
Java Equivalent code
priyanshi bhardwaj
Ranch Hand
Posts: 251
posted 6 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
Can some one convert this particular kotlin code to Java
val parent = viewFinder.parent as ViewGroup parent.removeView(viewFinder) parent.addView(viewFinder, 0) viewFinder.surfaceTexture = it.surfaceTexture updateTransform()
Or maybe explain me what this code is doing.Thanks in advance
priyanshi bhardwaj
Ranch Hand
Posts: 251
posted 6 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
And This piece of code also Please
val imageCapture = ImageCapture(imageCaptureConfig) capture_button.setOnClickListener { val file = File( externalMediaDirs.first(), "${System.currentTimeMillis()}.jpg" ) imageCapture.takePicture(file, object : ImageCapture.OnImageSavedListener { override fun onError( error: ImageCapture.UseCaseError, message: String, exc: Throwable? ) { val msg = "Photo capture failed: $message" Toast.makeText(baseContext, msg, Toast.LENGTH_SHORT).show() Log.e("CameraX Sample App", msg) exc?.printStackTrace() } override fun onImageSaved(file: File) { val msg = "Photo capture succeeded: ${file.absolutePath}" Toast.makeText(baseContext, msg, Toast.LENGTH_SHORT).show() Log.d("CameraX Sample App", msg) } }) }
Tim Moores
Bartender
Posts: 7645
178
posted 6 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
I advise to learn Kotlin. It is the future of Android prpgramming.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
App for accessing Camera
Joshua Bloch twitter today quiz: what is this >>>=
Kotlin: Get clicked item in recyclerview adapter
kotlin will be the future of java also in the backend?
Learning Python in order to learn Java better?
More...