检测主页按钮按下和长按Amazon fire TV应用程序?

时间:2018-10-11 03:51:37

标签: java android android-tv amazon-fire-tv ott

如何使主页按钮长按对话框屏幕事件以及不同的操作(例如应用程序,设置和睡眠...)在消防电视应用程序中回调?

Animation

我尝试执行下面的代码,能够在第3代电视上看到家庭按钮按下操作,但在第2代设备上不起作用。除了无法在应用程序内获得对话框事件按下操作之外。

#!/usr/bin/python

from flask import Flask, jsonify, current_app
from phoenix_dam import PhoenixDam
from flask import g

app = Flask(__name__)

global dbconn

@app.route('/')
def index():
   return "hello world !"


@app.route('/gettasks')
def get_tasks():
    return jsonify({'task1' : 'get milk', 'task2' : 'get food'})



@app.route('/mdef/api/v1/modelexecstats',methods=['GET'])
def get_model_exec_stats():
      query = "select * from test.table"
      dbconn = PhoenixDam.get_connection("/path/to/db/conf/db_conn.conf")
      res = PhoenixDam.read_data(dbconn, query)
      dbconn.close()
      return jsonify(res)


if __name__ == '__main__':
    app.run('0.0.0.0',debug=True)

HomeWatcher.class

HomeWatcher mHomeWatcher = new HomeWatcher(this);
    mHomeWatcher.setOnHomePressedListener(new OnHomePressedListener() {
        @Override
        public void onHomePressed() {
            // do something here...
        }
        @Override
        public void onHomeLongPressed() {
        }
    });
    mHomeWatcher.startWatch();

0 个答案:

没有答案