I am using a FragmentPagerAdapter to intialize the contents of a SlidingTabLayout. I don't want to open fragments on all of the tabs. Some of them will fire an intent and some will just open a dialog. How can I achieve this?
@Override
public Fragment getItem(int i) {
switch (i) {
case 0:
return FirstFragment.init();
case 1:
return OpenDialog.init();
case 2:
return DUIFragment.init();
case 3:
Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:" + number));
startActivity(callIntent);
0 comments:
Post a Comment