私はこの1つに固執していますが、それほど複雑ではありませんが、殴られてしまいました! 私がやろうとしているのは、最後のアクティビティの名前を取得してからインテントに渡すことで、ユーザーのセッションを再開することです。
私は立ち往生していますが、取得したStringをクラス名に変換しているので、resumeIntentはそれを使用できます。文字列の値をJavaクラス名に変換する
public void Resume (View view){
SharedPreferences sharedPref =
PreferenceManager.getDefaultSharedPreferences(MainActivity.this);
String resumeName = sharedPref.getString("ActivityName", null);
//probably need to do something here//
Intent resumeIntent = new Intent (this, resumeName);
startActivity(resumeIntent);}
あなたは '新しい意図(this、Class.forName(resumeName))'を試してみましたか? – Panther
大変ありがとうございます、それは完璧に動作します:) –