URL转换成二维码

{ Intent intent = new Intent(ContentActivity.this, MainActivity.class); intent.putExtras(bundle); startActivity(intent); } break; default: break; } }}复制代码

 

将二维码图片展示在页面上(后期会改为MVVM-DataBinding形式)

复制代码
public class MainActivity extends AppCompatActivity {    private ImageView iv;//    private String url = "http://weibo.com/cnwutianhao";    @Override    protected void>super.onCreate(savedInstanceState);        setContentView(R.layout.activity_main);        String str_url = getIntent().getExtras().getString("url");        iv = (ImageView) findViewById(R.id.iv_qrcode);        QRCodeUtil.showThreadImage(this, str_url, iv, R.mipmap.ic_launcher);    }}
复制代码

 

布局文件

①输入页面(后期会改为DataBinding形式)

复制代码