Android Quiz #2
You may lie here if you're shy ;)
Which is the most common order of methods being called in a View class?
onLayout, onMeasure, onDraw
onMeasure, onLayout, onDraw
onMeasure, onDraw, onLayout
How many bits in memory are taken by a bitmap with size 1024x800 and standard colors configuration ARGB_8888?
26 214 400
13 107 200
6 553 600
Let’s assume following stack of Activities. ActivityA -> ActivityB. ActivityB is on the top and is visible to a user. What the stack will look like if we call a startActivity(ActivityA) method, assuming that ActivityA’s launch mode is singleTop?
ActivityA -> ActivityB -> ActivityA
ActivityA and onNewIntent() method will be called
ActivityB -> ActivityA and onNewIntent() method will be called
Can a Kotlin data class have a `var` property in constructor?
No, only `val` properties to ensure immutability
Which method must be called in the ViewGroup.onMeasure() method?
Assume we have following layout structure FrameLayout-> LinearLayout-> TextView. The FrameLayout is a parent of LinearLayout and the LinearLayout is a parent of the TextView. All views are of the same size and are stacked on each other. Once we click on a screen, which view will call the onTouchEvent() method as first?
FrameLayout, because it is the root view
TextView, because touch events are dispatched to child views first
LinearLayout, assuming it returns true in onInterceptTouchEvent() method
LinearLayout, because it is the last ViewGroup in hierarchy
Select correct sentences. When using FCM (Firebase Cloud Messaging), messages with both notification and data payload are...
delivered to onMessageReceived() callback.
delivered to onMessageReceived() callback when app is in the foreground.
delivered to the device’s system tray when app is in the background. The data payload is delivered in the extras of the intent of launcher Activity.
delivered to the device’s system tray when app is in the background. The data payload is not delivered.
Is it possible to declare a var and val properties in Kotlin's interface?
Yes, both of them
Can an interface in Kotlin have a method with default implementation?
Yes, but only private
SurfaceView vs TextureView. Select correct sentences.
Only SurfaceView can be drawn and rendered from a separate thread.
In contrary to SurfaceView, a TextureView behaves as a regular View, you can animate, transform and scale it.
You can overlay two SurfaceViews.
TextureView can only be used in a hardware accelerated window.
Are you an Android developer? (not scored question)
Page 1 of 1
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google.
Terms of Service