A
Android Question
Guest
I am new in Android Development, I am developing a flash light app using fragments with Tab-Views, flashlight only turn on and off on the first tab only i.e
@override
public Fragment getItem(int position) {
switch (position){
case 0: return Strobes.newInstance("SecondFragment, Build 2");
case 1: return Effects.newInstance("ThirdFragment, Build3");
case 2: return Torch.newInstance("FirstFragment, Build 1");
default: return null;//return Torch.newInstance("ThirdFragment, Default");
}
}
Problem: Whoever is on case 0: has the ability to turn ON and OFF the flashlight. Others are just performing the button click events but not turning the flashlight ON and OFF. I mean case 1: & case 2: are just firing their on click events but not turning on the Flashlight. Can anyone tell me the solution please?
@override
public Fragment getItem(int position) {
switch (position){
case 0: return Strobes.newInstance("SecondFragment, Build 2");
case 1: return Effects.newInstance("ThirdFragment, Build3");
case 2: return Torch.newInstance("FirstFragment, Build 1");
default: return null;//return Torch.newInstance("ThirdFragment, Default");
}
}
Problem: Whoever is on case 0: has the ability to turn ON and OFF the flashlight. Others are just performing the button click events but not turning the flashlight ON and OFF. I mean case 1: & case 2: are just firing their on click events but not turning on the Flashlight. Can anyone tell me the solution please?