protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == RESULT_OK){ //拍照或者选择图片 if (requestCode == RESULT_CAPTURE_IMAGE || requestCode == RESULT_CHOOSE_IMAGE) { try { Uri uri = data.getData(); String[] proj = { MediaStore.Images.Media.DATA }; Cursor actualimagecursor = managedQuery(uri,proj,null,null,null); int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); actualimagecursor.moveToFirst(); String img_path = actualimagecursor.getString(actual_image_column_index); System.out.println("图片真实路径:"+img_path); // // ContentResolver resolver = getContentResolver(); // Uri uri = data.getData(); // System.out.println("选择图片路径:" + uri); // Bitmap img = MediaStore.Images.Media.getBitmap(resolver,uri); //// Bitmap bitmap = BitmapFactory.decodeStream(resolver.openInputStream(uri)); //// Bitmap img= (Bitmap)data.getExtras().get("data"); //获取缩略图 // try { // 压缩图片 // File file = new File(tempPath); // FileOutputStream outputStream = null; // outputStream = new FileOutputStream(file); // // if (img.getWidth() > 800 || img.getHeight() > 600) { // img = Bitmap.createScaledBitmap(img, 800, 600, false); // } // img.compress(Bitmap.CompressFormat.JPEG, 90, outputStream); // outputStream.flush(); // outputStream.close(); // // sendFile(file,uri.toString()); //发送图片 //// sendFile(tempPath); //发送图片 // // } catch (IOException e) { // e.printStackTrace(); // } // // img = null; // System.gc(); } catch (OutOfMemoryError e) { MyMethods.showMsg("获取图出错,请重新操作",this); e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } } }
<Application>net.rim.blackberry.lang.zh_CN</Application>
<Application>net.rim.blackberry.lang.zh.phoneticCore</Application>
<Application>net.rim.blackberry.lang.zh_CN.defaultResource</Application>
<Application>net.rim.blackberry.lang.zh_CN.localization</Application>
<Application>net.rim.blackberry.lang.zh_CN.rendering</Application>
<Application>net.rim.blackberry.lang.zh_CN.allInputs</Application>
<Application>net.rim.blackberry.lang.zh_CN_Pinyin</Application>
<Application>net.rim.blackberry.lang.zh_CN_Pinyin.linguisticData</Application>
<Application>net.rim.blackberry.lang.zh_CN_Pinyin.resources</Application>
<Application>net.rim.blackberry.lang.zh_CN.strokeLinguisticData</Application>
<Application>net.rim.blackberry.lang.zh_CN.rendering</Application>
在xml中增加这个即可支持中文显示;
如果想支持输入和其它菜单中文话,需要下载亚洲或中国版本的模拟器
Integer.toHexString(int i)
十进制转成八进制
Integer.toOctalString(int i)
十进制转成二进制
Integer.toBinaryString(int i)
十六进制转成十进制
Integer.valueOf("FFFF",16).toString()
八进制转成十进制
Integer.valueOf("876",8).toString()
二进制转十进制
Integer.valueOf("0101",2).toString()