FlashNotifier/src/main/java/com/pandanomic/flashnotifier/FragmentMainTab.java
public void initializeListeners(final View view){

        mSpinner.setOnItemSelectedListener(new APIDefaultItemSelectedListener());

        mServiceSwitch.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                toggleService();
            }
        });

        mPhoneCheckbox.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                updateUserPref(mPhoneCheckbox);
            }
        });

        mSMSCheckbox.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                updateUserPref(mSMSCheckbox);
            }
        });

        view.findViewById(R.id.tv_calls).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });

        // Test button for API
        view.findViewById(R.id.test).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (isServiceRunning()) {
                    ArrayList<Integer> pattern = new ArrayList<Integer>();
                    pattern.add(50);
                    pattern.add(50);
                    Intent i = new Intent("com.leepapesweers.flashnotifier.API");
                    i.putIntegerArrayListExtra("flash_pattern", pattern);
                    i.putExtra("calling_application", getActivity().getPackageName());
                    getActivity().sendBroadcast(i);
                } else {
                    Toast.makeText(getActivity(), "Service isn't running!", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
/**
     * Initialize the onClickListeners for the respective views
     * @param view the view containing the views we're updating
     */
Initialize the onClickListeners for the respective views
@param view the view containing the views we're updating
Initialize the onClickListeners for the respective views @param view the view containing the views we ' re updating
public void initializeListeners(final View view){
        mSpinner.setOnItemSelectedListener(new APIDefaultItemSelectedListener());
        mServiceSwitch.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                toggleService();
            }
        });
        mPhoneCheckbox.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                updateUserPref(mPhoneCheckbox);
            }
        });
        mSMSCheckbox.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                updateUserPref(mSMSCheckbox);
            }
        });
        view.findViewById(R.id.tv_calls).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
            }
        });
        view.findViewById(R.id.test).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (isServiceRunning()) {
                    ArrayList<Integer> pattern = new ArrayList<Integer>();
                    pattern.add(50);
                    pattern.add(50);
                    Intent i = new Intent("com.leepapesweers.flashnotifier.API");
                    i.putIntegerArrayListExtra("flash_pattern", pattern);
                    i.putExtra("calling_application", getActivity().getPackageName());
                    getActivity().sendBroadcast(i);
                } else {
                    Toast.makeText(getActivity(), "Service isn't running!", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
public void initializeListeners ( final View view ) { mSpinner . setOnItemSelectedListener ( new APIDefaultItemSelectedListener ( ) ) ; mServiceSwitch . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { toggleService ( ) ; } } ) ; mPhoneCheckbox . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { updateUserPref ( mPhoneCheckbox ) ; } } ) ; mSMSCheckbox . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { updateUserPref ( mSMSCheckbox ) ; } } ) ; view . findViewById ( R . id . tv_calls ) . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { } } ) ; view . findViewById ( R . id . test ) . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { if ( isServiceRunning ( ) ) { ArrayList < Integer > pattern = new ArrayList < Integer > ( ) ; pattern . add ( 50 ) ; pattern . add ( 50 ) ; Intent i = new Intent ( "com.leepapesweers.flashnotifier.API" ) ; i . putIntegerArrayListExtra ( "flash_pattern" , pattern ) ; i . putExtra ( "calling_application" , getActivity ( ) . getPackageName ( ) ) ; getActivity ( ) . sendBroadcast ( i ) ; } else { Toast . makeText ( getActivity ( ) , "Service isn't running!" , Toast . LENGTH_SHORT ) . show ( ) ; } } } ) ; }
Initialize the onClickListeners for the respective views
 @param view the view containing the views we're updating
Initialize the onClickListeners for the respective views @param view the view containing the views we ' re updating
// Test button for API