M
M
MaxFB2017-09-11 19:26:04
Java
MaxFB, 2017-09-11 19:26:04

What is this for here?

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // создание TextView
        TextView textView = new TextView(this);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Egor Kazantsev, 2017-09-11
@saintbyte

This is somewhat I remember this Context , in this case this is activity

C
Comatu, 2017-09-11
@Comatu

I also recently studied this issue and realized that the this context in this case is needed in order to style the View in accordance with the style (theme) of this Activity

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question