我正在开发一个绘画应用程序,我想在其中将Bitmap图像从一个活动传递到另一个活动,但项目没有响应.我将相对布局截图转换为位图并将其传递给Intent但问题仍未解决.这是我的代码....
DrawingActivity
package com.newdrawing;
public class DrawingActivity extends Activity {
private Bitmap mBitmap;
private Canvas mCanvas;
private Path mPath;
private Paint mBitmapPaint;
private Paint mPaint;
MyDrawView myDrawView;
RelativeLayout parent;
Bitmap bitmap;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_drawing);
parent = (RelativeLayout) findViewById(R.id.singleparent);
myDrawView = new MyDrawView(this);
parent.addView(myDrawView);
Activity context;
//RelativeLayout item = (RelativeLayout)findViewById(R.id.item);
View child = getLayoutInflater().inflate(R.layout.trans, null);
parent.addView(child);
}
public void color(View v) {
switch (v.getId()) {
case R.id.button3:
parent.setBackgroundColor(Color.RED);
break;
case R.id.button4:
parent.setBackgroundColor(Color.GREEN);
break;
case R.id.button5:
parent.setBackgroundColor(Color.BLUE); …Run Code Online (Sandbox Code Playgroud) 我们正在开发一款应用.我们从json数组中获取数据.在那我想要替换标签.但是模拟器抛出错误.类似于无效的语法.我的代码:
top=top.replaceall("<br\/>"," ");
Run Code Online (Sandbox Code Playgroud)
请帮忙.提前致谢