1

I wonder if there is some method to detect when an android user opens/closes the application drawer in his phone. Also, if the user has a folder in the homescreen, is there some kind of log event that detects this interaction?

I need to get that information in my application.

Thanks.

  • http://stackoverflow.com/questions/21633791/how-to-detect-if-navigation-drawer-is-open – 2Dee Sep 16 '14 at 11:48
  • I think this link is not what I'm searching for. I mean, this is for a navigation drawer, but I need to know when the user opens the application drawer (system drawer). DrawerLayout mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); I don't know how to "invoke" the system drawer, not a drawer that I create in my layout, – user2512569 Sep 16 '14 at 12:23
  • Forget it. There are hundreds of launcher app, and you would need to have a rooter phone to read the logs of other apps. – Stephane Mathis Sep 16 '14 at 12:25
  • It's not a problem to have a rooter phone, it's for a personal app. But I don't understand which other apps are involved here. I want to read information from the "system" (or maybe I'm wrong, not sure). – user2512569 Sep 17 '14 at 07:12

1 Answers1

0

yes you can...

you have to implement the DrawerLayout.DrawerListener for drawer layout

public abstract void onDrawerClosed (View drawerView)

Called when a drawer has settled in a completely closed state. Parameters

public abstract void onDrawerOpened (View drawerView)

Called when a drawer has settled in a completely open state.

public abstract void onDrawerSlide (View drawerView, float slideOffset)

Called when a drawer's position changes.

public abstract void onDrawerStateChanged (int newState)

Called when the drawer motion state changes.

Sam
  • 4,046
  • 8
  • 31
  • 47
  • 1
    The problem, it's that I don't know how to receive that info, when user press the "system button" that opens the applications draw, not a personal navigation drawer created for me. I need to know what I have to write to "call" that drawerView – user2512569 Sep 17 '14 at 07:14