微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android.provider.SyncStateContract.Constants的实例源码

项目:Chitchat    文件ChatsActivity.java   
@Override
protected void onActivityResult(int requestCode,int resultCode,Intent data) {
    // Todo Auto-generated method stub
    super.onActivityResult(requestCode,resultCode,data);
    if(resultCode == RESULT_OK)
    {
        //add to gallery
        if(requestCode==PICTURE_INTENT_CODE||requestCode==VIDEO_INTENT_CODE){
        Intent galleryAddIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
        galleryAddIntent.setData(mMediaUri);
        sendbroadcast(galleryAddIntent);

        Intent sendIntent = new Intent(ChatsActivity.this,RecipientsActivity.class);
        sendIntent.setData(mMediaUri);
        String type = new String();
        if(requestCode == PICTURE_INTENT_CODE)
        {
            type = com.shivamb7.chitchat.workers.Constants.TYPE_PICTURE;
        }
        else if(requestCode == VIDEO_INTENT_CODE)
        {
            type = com.shivamb7.chitchat.workers.Constants.TYPE_VIDEO;
        }


        sendIntent.putExtra(com.shivamb7.chitchat.workers.Constants.FILE_TYPE,type);
        startActivity(sendIntent);
    }
        else
        {

        }
    }
    else if(resultCode != RESULT_CANCELED)
    {
        Toast.makeText(this,"There was an error",Toast.LENGTH_SHORT).show();
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。