文档介绍:android dp和px之间转换
public class DensityUtil {
/**
* 根据手机的分辨率从 dip 的单位转成为 px(像素)
*/
public static int dip2px(Context context, float dpValue) {
final float scale = ().getDisplayMetrics().density;
return (int) (dpValue * scale + );
}
/**
* 根据手机的分辨率从 px(像素) 的单位转成为 dp
*/
public static int px2dip(Context context, float pxValue) {
final float scale = ().getDisplayMetrics().density;
return (int) (pxValue / scale + );
}
}
android INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
Nothing, the application was built with a previous version of Google's SDK. In other words, it's old and needs rebuilt with the latest version of the SDK running on the phone. Google just frooze v1 of the SDK like a month ago. Before that the SDK was changing so don't be surprised if stuff won't install. From here forward the public APIs we developers use are frozen but features will be added and bugs fixed.
android root下禁用组件
pm .htc..
android 对话框样式
<style name="MyDialog" parent="***@android:">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">***@color/ha</item>
</style>
根据uri获取路径
Uri uri = ();
String[] proj = { };
Cursor actualimagecursor = managedQuery(uri,proj,null,null,null);
int actual_image_column_index = ();
();
String img_path = (actual_image_column_index);
File file = new File(img_path);
android 根据uri获取真实路径
public static String getRealFilePath( final Context context, final Uri uri ) {
if ( null == uri ) return null;
final String scheme = ();
String data = null;
if ( scheme == null )
data = ();
else if ( ( scheme ) ) {