程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程解疑 >> 對象-請問這裡的this是指什麼呢?

對象-請問這裡的this是指什麼呢?

編輯:編程解疑
請問這裡的this是指什麼呢?

public abstract class BaseActivity extends FragmentActivity implements UiOperation {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(getLayoutResID());
    View rootView = findViewById(android.R.id.content); // android.R.id.content這個id可以獲取到Activity的根View
    Utils.findButtonSetOnClickListener(rootView,** this**);//這個this是指?
    initView();
    initListener();
    initData();
}
其中UiOperation定義為public interface UiOperation extends OnClickListener

Utils.findButtonSetOnClickListener方法定義為public static void findButtonSetOnClickListener(View view, OnClickListener listener)

最佳回答:


this就是指當前對象。類實例化後都有一個this指針,指向當前對象的引用地址。

theSnai1
theSnai1
wojiushiwo945you
u010880786
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved