简体   繁体   中英

Basic Android development questions

onCreate(Bundle State)
{
    TextView label = new TextView(this);
    lable.setText("My new Label");
}

I read that the TextView has a reference to the Activity . What does it mean for something to have a reference on something else?

每当活动是活动包含文本视图时,文本视图将自动被销毁。

从实际的角度来看,这意味着不建议您将TextView保留在静态变量中的某个位置,因为那样您将保留整个Activity。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM