[問題] AIDE上的this的問題
我在平板電腦上裝了AIDE直接在平板上發展程式
但遇到一個問題
public class MainActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
....
}
public void test(View v)
{
TextView nv = new TextView(this); // AIDE error
nv.setText("this is a test");
.....
}
}
我找到的範例都是傳入參數 this
但是AIDE卻要求傳入 MainActivity.this
初學者觀念不是很清楚
請問這個意思是?
--
Sent from my Android
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.105.29.190
→
03/05 16:49, , 1F
03/05 16:49, 1F
→
03/05 17:11, , 2F
03/05 17:11, 2F
→
03/05 17:11, , 3F
03/05 17:11, 3F