Skip to content

Instantly share code, notes, and snippets.

// Using R.layout.activity_main from the main source set
import kotlinx.android.synthetic.main.activity_main.*
public class MyActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
textView.setText("Hello, world!") // Instead of findView(R.id.textView) as TextView
}
}
public class SplashView extends View {
private Bitmap bitmap;
public SplashView(Context context) {
super(context);
init();
}
private void init() {
bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.logo);