-1

I'm developing some app with a DrawerLayout for many kinds of devices, now.. when the app installed in old api the app crashes because DrawerLayout is not supported or something. how can i get in my java code what is the current device for handle the drawer respectively? or if the drawer not available. I tried this:

if(drawer != null){
//its ok!
}else{
//the app without DrawerLayout !
}

but it doesn't working for me... please help me!!!

ANDROBIB
  • 21
  • 5

1 Answers1

1

DrawerLayout is part of the Support Library. You include the Support Library in your project, so it gets compiled into your APK. There should be no reason the for this code to fail on older devices, otherwise it wouldn't be a very good support library, would it?

Karakuri
  • 38,365
  • 12
  • 84
  • 104
  • i cant install my app on sony ericsson xperia arc but in galaxy s4 its work fine and when i cancelled the reference its work on xperia too .. why that? – ANDROBIB May 02 '14 at 22:46
  • There are any number of reasons an app would not install on a particular device. I very much doubt it has anything to do with the support library for the reason I already stated. Check your manifest for any restrictions that would prevent the installation. `minSdkVersion`, `supports-screens`, and `uses-feature` elements are possible candidates. – Karakuri May 02 '14 at 22:51