TextView textView = findViewById(R.id.textView); // get the TextView element Drawable drawable = context.getResources().getDrawable(R.drawable.background_image); // get the drawable image textView.setBackgroundDrawable(drawable); // set the drawable as the background of the TextViewThis will set the `background_image` drawable as the background of the TextView with the ID `textView`. The package library that contains the `android.widget.TextView` class is the `android.widget` package, which is part of the Android SDK.