Example usage for android.hardware ConsumerIrManager hasIrEmitter

List of usage examples for android.hardware ConsumerIrManager hasIrEmitter

Introduction

In this page you can find the example usage for android.hardware ConsumerIrManager hasIrEmitter.

Prototype

public boolean hasIrEmitter() 

Source Link

Document

Check whether the device has an infrared emitter.

Usage

From source file:com.avloop.simplerc.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ConsumerIrManager mCIR = (ConsumerIrManager) getSystemService(CONSUMER_IR_SERVICE);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        Log.e(TAG, "mCIR.hasIrEmitter(): " + mCIR.hasIrEmitter());
    }//from  w w  w .ja v a  2  s.  com
    setContentView(R.layout.activity_main);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    remote = new TataSkyRemote(mCIR);

    TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
    ViewPager viewPager = (ViewPager) findViewById(R.id.pager);

    viewPager.setAdapter(new SectionPagerAdapter(getSupportFragmentManager()));
    tabLayout.setupWithViewPager(viewPager);

    /*Button fab = (Button) findViewById(R.id.power);
    fab.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        remote.sentIR(Keys.POWER);
    }
    });
    */
}