たとえば、resultPhone から返された名前のアクティビティに移動したい: 現在の電話名は GalaxyS3 で、GalaxyS3.class に移動したい。どうやってやるの?
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String[] supportedPhone = getResources().getStringArray(R.array.supported_phone);
String[] supportedVersion = getResources().getStringArray(R.array.supported_version);
String currentPhone = android.os.Build.MODEL;
String currentVersion = android.os.Build.VERSION.RELEASE;
for(String cP : supportedPhone) {
String resultPhone = cP;
for(String cV : supportedVersion) {
String resultVersion = cV;
if ((currentPhone.equalsIgnoreCase(resultPhone)) && (currentVersion.equalsIgnoreCase(resultVersion))) {
Intent gotoPhoneDetail = new Intent(this, "resultPhone" + ".class");
startActivity(gotoPhoneDetail);
// how can i make this go to the activity with the name return from resultPhone?
} else {
setContentView(R.layout.phone_checker);
}
}
}
}