java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation | Android Oreo

Checkout java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation | Android Oreo The problem seems to be happening when your target sdk is 28. So after trying out many options finally this worked. style:- Note:parent=”Theme.AppCompat.Light.NoActionBar” is needed for api 28. Previously had something else at api 26. Was working great Read more…

How to create RecyclerView with multiple view type? | RecyclerView with multiple view type

Checkout How to create RecyclerView with multiple view type? | RecyclerView with multiple view type Yes, it’s possible. Just implement getItemViewType(), and take care of the viewType parameter in onCreateViewHolder(). So you do something like: The simplest and most robust way to get the user’s current location on Android? Here’s what I do: First Read more…

How to Disable landscape mode in Android? | Disable landscape in android | Portrait only in android

Checkout the How to Disable landscape mode in Android? | Disable landscape in android | Portrait only in android Add android:screenOrientation=”portrait” to the activity in the AndroidManifest.xml. For example: EDIT: Since this has become a super-popular answer, I feel very guilty as forcing portrait is rarely the right solution to the problems Read more…

How do I pass data between Activities in Android application? | Android activity communication

Checkout the How do I pass data between Activities in Android application? | Android activity communication The easiest way to do this would be to pass the session id to the signout activity in the Intent you’re using to start the activity: Intent intent = new Intent(getBaseContext(), SignoutActivity.class); intent.putExtra(“EXTRA_SESSION_ID”, sessionId); Read more…

Social Media Auto Publish Powered By : XYZScripts.com