ImageView btnModule1 = (ImageView) findViewById(R.id.btnModule1);
btnModule1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//重启方法一
//reload();
//重启方法二
//finish();
Intent i = new Intent(“android.intent.action.MAIN”);
ComponentName cn = new ComponentName(“com.activity.test”,
“com.activity.test.TestView”);
i.setComponent(cn);
TestView.this.startActivity(i);
}
});
public void reload() {
Intent intent = getIntent();
overridePendingTransition(0, 0);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
finish();
overridePendingTransition(0, 0);
startActivity(intent);
}