can’t resolve AppCompatActivity

Okay, to anybody who might stumble upon this now, Android Studio is very, very, very weird. Solution : Go to your build.gradle file and in your dependencies find the appcompat one, something like compile ‘com.android.support:appcompat-v7:XX.X.X’ Change it to compile ‘com.android.support:appcompat-v7:XX.X.+’ Then click on Sync Now on the top right of the editor. All the red … Read more

USE_FINGERPRINT is deprecated in API level 28

I’ve faced the same problem, imho the short answer is to ignore the deprecation, as long as you only want to support fingerprint authentication in your app. As stated in the google dev blog, since API 28 google comes up with the new biometrics API, which simplifies the whole process of biometrics authentication. They provide … Read more

ComponentActivity vs AppCompatActivity in Android Jetpack Compose

AppCompatActivity extends FragmentActivity which extends ComponentActivity. ComponentActivity has all you need for a Compose-only app. If you need AppCompat APIs, an AndroidView which works with AppCompat or MaterialComponents theme, or you need Fragments then use AppCompatActivity. Note: it requires at least the AppCompat 1.3.0 version.

AppCompat v7 Toolbar onOptionsItemSelected not called

I know this question has been answered but I found the real cause of the problem after 2 days of frustration. Take a look at the ActionBarDrawerToggle documentation: https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.html Notice the two constructors there. My mistake was that I was using the second constructor that was taking a toolbar as a parameter. It took me … Read more

What’s the difference between LinearLayout and LinearLayoutCompat

LinearLayoutCompat was added to support methods which were added in newer API levels on old ones (like dividers). If you compare the methods in LinearLayout and LinearLayoutCompat you can see that the Compat layout has all methods of the LinearLayout without any API level limitation. This brings us back to your question: You are trying … Read more

Don’t collapse Toolbar when RecyclerView fits the screen

Final Solution (thanks MichaƂ Z.) Methods to turn off/on Toolbar scrolling: public void turnOffToolbarScrolling() { Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar); AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appbar_layout); //turn off scrolling AppBarLayout.LayoutParams toolbarLayoutParams = (AppBarLayout.LayoutParams) mToolbar.getLayoutParams(); toolbarLayoutParams.setScrollFlags(0); mToolbar.setLayoutParams(toolbarLayoutParams); CoordinatorLayout.LayoutParams appBarLayoutParams = (CoordinatorLayout.LayoutParams) appBarLayout.getLayoutParams(); appBarLayoutParams.setBehavior(null); appBarLayout.setLayoutParams(appBarLayoutParams); } public void turnOnToolbarScrolling() { Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar); AppBarLayout appBarLayout = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)