0
我试图用我自己的功能开始活动,但它不工作(认为它是一个逻辑错误;))Android的自身活动启动功能
请看看:
Intent adder = new Add().execute(this, Add.class, "Test:","Add the test");
startActivity(adder);
这是我要开始活动:
public class Add extends Activity {
public Intent execute(Context context, Class<?> cls, String addText, String buttonText) {
TextView addStr = (TextView) findViewById(R.id.addtext);
addStr.setText(addText);
Button addBtn = (Button) findViewById(R.id.addbtn);
addBtn.setText(buttonText);
return new Intent(context, cls);
}
}
有什么不对?
您如何看待我在活动中看到的内容?我想为两个动作使用一个活动,所以我必须更改活动中的一些文本。 –