This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MainActivity extends Activity { | |
public void onArticleSelected(int position) { | |
} | |
public static void onArticleSelected(MainActivity activity, int position) { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HeadLineFragment extends Fragment { | |
public <T> void setHeadlineListener(HeadlineListener<T> listener) { | |
... | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HeadLineFragment extends ListFragment { | |
@Override | |
public void onListItemClick(ListView l, View v, int p, long i) { | |
// Send the event to the host activity | |
// we should probably check if the activity is finishing|destroyed|rotating | |
mCallback.onArticleSelected(getActivity(), p); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import toothpick.Scope | |
import toothpick.Toothpick | |
import kotlin.properties.ReadOnlyProperty | |
import kotlin.reflect.KProperty | |
annotation class ActivityScope | |
annotation class FreeScope | |
//------------------------- | |
// case: Entry point |
OlderNewer