Skip to content

Commit

Permalink
Android 13: Fix warnings on starting an application
Browse files Browse the repository at this point in the history
On Android 13, currently in beta, android triggers a warning because it
is using a deprecated getDrawable function.
The patch changes it to use the non-deprecated alternative as suggested
in the warning.

Fixes: QTBUG-103568
Change-Id: I3e629e7b75044bfb51874256895be0ec7e1088f8
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit e07fea6)
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
  • Loading branch information
samueljosemira committed Jun 28, 2022
1 parent 5199ae4 commit e80b0f3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ public void run() {
m_splashScreenSticky = info.metaData.containsKey("android.app.splash_screen_sticky") && info.metaData.getBoolean("android.app.splash_screen_sticky");
int id = info.metaData.getInt(splashScreenKey);
m_splashScreen = new ImageView(m_activity);
m_splashScreen.setImageDrawable(m_activity.getResources().getDrawable(id));
m_splashScreen.setImageDrawable(m_activity.getResources().getDrawable(id, m_activity.getTheme()));
m_splashScreen.setScaleType(ImageView.ScaleType.FIT_XY);
m_splashScreen.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
m_layout.addView(m_splashScreen);
Expand Down Expand Up @@ -1258,7 +1258,7 @@ public void createSurface(int id, boolean onTop, int x, int y, int w, int h, int
if (attr.type >= TypedValue.TYPE_FIRST_COLOR_INT && attr.type <= TypedValue.TYPE_LAST_COLOR_INT) {
m_activity.getWindow().setBackgroundDrawable(new ColorDrawable(attr.data));
} else {
m_activity.getWindow().setBackgroundDrawable(m_activity.getResources().getDrawable(attr.resourceId));
m_activity.getWindow().setBackgroundDrawable(m_activity.getResources().getDrawable(attr.resourceId, m_activity.getTheme()));
}
if (m_dummyView != null) {
m_layout.removeView(m_dummyView);
Expand Down

0 comments on commit e80b0f3

Please sign in to comment.