I want that the menu i have created for testing entries should come in debug mode but when i release(launch) my application the menu should not be displayed for testing entries. Can anyone help me for this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check for
IS_DEBUG_MODEflag in your application and add code in that..Use
PackageManagerto get anApplicationInfoobject on your application, and check the flags field forFLAG_DEBUGGABLE.Update:
The following solution assumes that in manifest file you always set
android:debuggable=truewhile developing andandroid:debuggable=falsefor application release.Now you can check this attribute’s value from your code by checking the
ApplicationInfo.FLAG_DEBUGGABLEflag in theApplicationInfoobtained fromPackageManager.The following code snippet could help:
So in your manifest file:
For debug time,
For release time,