in the following code :
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btn = (Button) findViewById(R.id.btn1);
// On button click call this listener
btn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Thread background = new Thread(new Runnable() {
public void run() {
//Do some work here !
}};
};
above in the code the new new OnClickListener()
is an Anonymous Inner Classes inside the class MainActivity
, but what about the new Thread(new Runnable()
is this class also an inner class and which class is the outer class for it ??? and if it's an inner class inside new OnClickListener()
can this class access the MainActivity Members ?