0
在Android中,有沒有更優雅的方式來檢索內部類中的應用程序上下文而不是傳遞上下文作爲參數?在Android中,是否有更優雅的方式來檢索內部類中的應用程序上下文?
public class MainActivity extends Activity {
class SeekBarChangeListener implements SeekBar.OnSeekBarChangeListener
{
private Context context;
private TextView distanceTextView;
public SeekBarChangeListener(Context context, TextView distanceTextView) {
this.context = context;
this.distanceTextView = distanceTextView;
}
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
}