• Button switch..case 语句监听按钮点击的方法。。下面这方法好。


    public void onClick(View v) {
            switch (v.getId()) {
            case R.id.btnEditOk: {           //点击编辑完成 ,它就调到 ShareActvity页面去了
       if(NullCheckUtil.isNotNull(edit_text.getText().toString())){
                String cotent=edit_text.getText().toString();
                try {
                    share2weibo(cotent, imagePath);
                    this.finish();
                } catch (WeiboException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
       }else{
            Toast.makeText(this, "说点什么把...", Toast.LENGTH_SHORT);
       }
           break;
            }case R.id.btnSelectImage:{
                Intent intent = new Intent();
                intent.setType("image/*");
                intent.setAction(Intent.ACTION_GET_CONTENT);
                startActivityForResult( intent, 1);
                break;
            }
            }
    
        }
  • 相关阅读:
    kvm virtio
    GPU 线程块/线程束
    ubuntu source
    React
    分布式系统
    honpeyhonepy
    css是干什么的
    bootstrap中的横的列
    数据安全之 alert logic
    viewset的使用的方法
  • 原文地址:https://www.cnblogs.com/firecode/p/2685530.html
Copyright © 2020-2023  润新知