2、手机iOS系统不是最新版本,客户端不兼容。如果条件允许,可以更新系统到8.3后再上传即可。
3、安卓的一般会出现新区上传不了的情况,如果查询到所在服务器属于近期开放服务器,那么很可能是因为目前上传的玩家太多,导致上传服务器堵塞,部分玩家上传失败。更换一个时间或者错开这两天的上传高峰再上传照片。
4、一般人工审核在24小时内(节假日例外),如果您的照片已经通过审核,尝试大退一下游戏,重新登录就可以看到。
梦幻西游手游攻略:http://bbs.xiaopi.com/forum-156-1.html
首先是拍照:使用Intent即可,[java] view plaincopyprint?
01.final String start = Environment.getExternalStorageState()
02.private static final String PHOTOPATH = "/photo/"
03.
04.if(start.equals(Environment.MEDIA_MOUNTED)){
05.Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE)
06.File file = new File(Environment.getExternalStorageDirectory()+PHOTOPATH)
07.if(!file.exists()){
08.file.mkdirs()
09.}
10.tempphontname = System.currentTimeMillis()+".jpg"
11.buffer.append(Environment.getExternalStorageDirectory()+PHOTOPATH).append(tempphontname)
12.intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(buffer.toString())))
13.startActivityForResult(intent, 1)
14.}
final String start = Environment.getExternalStorageState()
private static final String PHOTOPATH = "/photo/"
if(start.equals(Environment.MEDIA_MOUNTED)){
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE)
File file = new File(Environment.getExternalStorageDirectory()+PHOTOPATH)
if(!file.exists()){
file.mkdirs()
}
tempphontname = System.currentTimeMillis()+".jpg"
buffer.append(Environment.getExternalStorageDirectory()+PHOTOPATH).append(tempphontname)
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(buffer.toString())))
startActivityForResult(intent, 1)
}
其次是从本地相册选:依旧是Intent.
如下代码:
[java] view plaincopyprint?
01.if(start.equals(Environment.MEDIA_MOUNTED)){
02.Intent getImage = new Intent(Intent.ACTION_GET_CONTENT)
03.getImage.addCategory(Intent.CATEGORY_OPENABLE)
04.getImage.setType("image/jpeg")
05.startActivityForResult(getImage, 0)
06.}
if(start.equals(Environment.MEDIA_MOUNTED)){
Intent getImage = new Intent(Intent.ACTION_GET_CONTENT)
getImage.addCategory(Intent.CATEGORY_OPENABLE)
getImage.setType("image/jpeg")
startActivityForResult(getImage, 0)
}
接下来是主要的:因为调用完系统的方法后,回返回到回调方法onActivityResult(int, int, Intent)中,
在里面进行主要的照片上传服务器的操作,
见代码:
[java] view plaincopyprint?
01.@Override
02.protected void onActivityResult(int requestCode, int resultCode, Intent data) {
03.ContentResolver resolver = getContentResolver()
04.if(requestCode==1)//
05.{
06.if(resultCode==Activity.RESULT_OK)
07.{
08.if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
09.{
10.ew Thread(new Runnable()
11.{
12.@Override
13.public void run() {
14.//进行上传操作
15.}
16.}.start()
转载
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)