日期:2014-05-19  浏览次数:20747 次

android继承 AlertDialog 怎么跳转页面呢? 在线等啊,也可以QQ:416667164,谢谢大虾了。
android继承 AlertDialog 怎么跳转页面呢? 在线等啊,谢谢大虾了。

这个类本身就是我其它页面弹出的一个可编辑框,
public class Dialog_edit extends AlertDialog implements OnClickListener, android.view.View.OnClickListener{

public interface OnDateSetListener {
void onDateSet(String text);
}

protected Dialog_edit(Context context, String title, String value,String process,
OnDateSetListener Callback) {
super(context);
mCallback = Callback;


editA = new EditText(context);
editA.setText(title);
editA.setOnClickListener(this);//我想点击编辑框跳转到另外一个Activity

layout = new LinearLayout(context);
layout.setOrientation(LinearLayout.VERTICAL);

LinearLayout.LayoutParams lparam = new LinearLayout.LayoutParams(200,50);
layout.addView(edit, lparam);

setView(layout);
setTitle(title);
setButton("确定", this);
setButton2("取消", (OnClickListener) null);
}


public void onClick(View v) {
if (v.equals(editA)){
//这里不知道该怎么写??? 继承的AlertDialog ,貌似用Intent intent = new Intent();不行啊。
}
}

------解决方案--------------------
Activity act = new Activity(this,anotherActivity.class);
用这个可以不?