Android 中实现 Activity 的跳转
2010-03-25 17:04:00 来源:WEB开发网核心提示:@Overridepublic void onClick(View v) {Intent intent = new Intent();intent.setClass(androidForward.this, ForwardTarget.class);startActivity(intent);finish();//停止
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setClass(androidForward.this, ForwardTarget.class);
startActivity(intent);
finish();//停止当前的Activity,如果不写,则按返回键会跳转回原来的Activity
}
});
}
}
ForwardTarget:
Java代码
package com.ray.forward;
import android.app.Activity;
import android.os.Bundle;
public class ForwardTarget extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.leah1);
}
}
更多精彩
赞助商链接