I work with interfaces, thus before starting certain activity I create it, assign pointer to the public property of the activity to start (I want to run some function from activity to start and the implementation of course in starting activity) The code
ActivityToStart act = new ActivityToStart ();
act.delegate = (MyInterface) StartingActivity.this;
Intent i = new Intent(StartingActivity.this,ActivityToStart.class);
act.startActivity(i);
StartingActivity implements MyInterface.
I get an error, unfortunately not informative (null pointer exception)
Why?