在Android上,您如何检测用户何时打开系统通知抽屉?我还没有找到执行此操作所需的电话,即使可能?它是否会导致我可以监控的系统通知?
答案 0 :(得分:1)
我在另一个SO问题中找到了我的问题的答案......
Disable the notification panel from being pulled down
这是一个不同的问题,但响应状态栏/通知抽屉行为变化的方式是我想要的。我正在寻找的是回复select * from my_table
where AddressLine not in (select AddressLine from my_table
group by AddressLine
where AddressLine is not null
having count(*) >1);
以及将onWindowFocusChanged
行添加到清单。
答案 1 :(得分:0)
试试这个:
private ActionBarDrawerToggle mToggle;
private DrawerLayout drawer_layout;
@Override
protected void onCreate(Bundle savedInstanceState) {
// ...
drawer_layout = (DrawerLayout)findViewById(R.id.your_drawer_layout);
mToggle = new ActionBarDrawerToggle(this, drawer_layout, "open", "close");
drawer_layout.addDrawerListener(mToggle);
mToggle.syncState();
// ...
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (mToggle.onOptionsItemSelected(item)) {
Log.d(TAG, "drawer opened");
}
return true;
}