• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Android Fragments

Case 1: & case 2: are just firing their on click events but not turning on the Flashlight. Can anyon

  • 5

    Votes: 0 0.0%
  • 5

    Votes: 0 0.0%

  • Total voters
    0
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?
 
Back
Top Bottom