这么久都没人答...人气凋零...
The following solution assumes that in manifest file you always set android:debuggable=true while developing and android:debuggable=false for application release.Now you can check this attribute's value from your code by checking the ApplicationInfo.FLAG_DEBUGGABLE flag in the ApplicationInfo obtained from PackageManager.The following code snippet could help:
PackageInfo packageInfo = ... // get package info for your context
int flags = packageInfo.applicationInfo.flags;
if ((flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
// development mode
} else {
// release mode
}
from:http://stackoverflow.com/questio ... settings-on-android
The following solution assumes that in manifest file you always set android:debuggable=true while developing and android:debuggable=false for application release.Now you can check this attribute's value from your code by checking the ApplicationInfo.FLAG_DEBUGGABLE flag in the ApplicationInfo obtained from PackageManager.The following code snippet could help:
PackageInfo packageInfo = ... // get package info for your context
int flags = packageInfo.applicationInfo.flags;
if ((flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
// development mode
} else {
// release mode
}
from:http://stackoverflow.com/questio ... settings-on-android
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货