将二维码图片展示在页面上(后期会改为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形式)